Zhlw.com - 中华龙网

站长资讯通告:
搜索: 您的位置中华龙网 > 计算机网络 > 网络编程 > ASP.NET > 文章列表

容器中控件的拖动

作者:bear  来源:转载  发布时间:2006-1-25 16:59:59
 Private Sub PictureBox2_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox2.MouseDown

        Me.PictureBox2.DoDragDrop(sender, DragDropEffects.Move)

    End Sub

    Private Sub GroupBox1_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles GroupBox1.DragEnter

        e.Effect = DragDropEffects.Move '拖放事件的目标所允许的动作

    End Sub

    Private Sub GroupBox1_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles GroupBox1.DragDrop

        Me.PictureBox1.Controls.Remove(Me.PictureBox2)

        Me.GroupBox1.Controls.Add(Me.PictureBox2)

        Me.PictureBox2.Left = 0

        Me.PictureBox2.Top = 10

        MessageBox.Show("dfgdf")

    End Sub

    Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Me.GroupBox1.AllowDrop = True

        Me.PictureBox1.AllowDrop = True

    End Sub

        用户名: 验证码: 验证码,看不清楚?请点击刷新验证码 (注“”为必填内容。)


文章评论: [ 查看全部 ] 网友评论
关于本站 - 网站帮助 - 广告合作 - 友情连接 - 网站地图