容器中控件的拖动(从一个容器到另一个容器)

王朝c#·作者佚名  2006-12-17
宽屏版  字体: |||超大  

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

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
© 2005- 王朝网络 版权所有