当前位置:编程学习 > asp >>

容器中控件的拖动

 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

 

补充:Web开发 , ASP.Net ,
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,