首页 > Web开发 > 详细

[VB.NET]拖动操作的技术基础

时间:2014-09-07 00:57:54      阅读:487      评论:0      收藏:0      [点我收藏+]

1、设置需要接受拖动事件的控件的AllowDrop属性为True,在开发界面时配置,不可通过代码配置

2、在DragEnter事件处理程序里,为e.Effet设置枚举值,否则拖动无效

    Private Sub GroupBox1_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles GroupBox1.DragEnter
        e.Effect = DragDropEffects.Link
    End Sub

3、在DragDrop事件中处理拖入的内容

    Private Sub GroupBox1_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles GroupBox1.DragDrop
        s = e.Data.GetData(System.Windows.Forms.DataFormats.FileDrop)
        Me.Text = "File Pro - 正在移动文件"
    End Sub

 4、获取拖入的内容

s = e.Data.GetData(System.Windows.Forms.DataFormats.FileDrop)

 

[VB.NET]拖动操作的技术基础

原文:http://www.cnblogs.com/sunsoftresearch/p/3959957.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!