Dim xy As New System.Drawing.Point(e.X, e.Y) xy.Offset(-me.Location.X, -me.Location.Y) xy.Offset(-pnlDrop.Location.X, -pnlDrop.Location.Y)~~Bonnie
>Public Class Form1 > Inherits System.Windows.Forms.Form > Private m_PickedUp As Button > > Private Sub btnDrag_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles btnDrag.MouseDown > m_PickedUp = CType(sender, Button) > m_PickedUp.DoDragDrop(sender, DragDropEffects.Copy) > End Sub > > Private Sub pnlDrop_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles pnlDrop.DragEnter > e.Effect = DragDropEffects.Copy > End Sub > > Private Sub pnlDrop_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles pnlDrop.DragDrop > Dim theBtn As Button = CType(m_PickedUp, Button) > pnlDrop.Controls.Add(theBtn) > 'theBtn.Top = e.X > 'theBtn.Left = e.Y > Dim xy As New System.Drawing.Point(e.X, e.Y) > theBtn.Location = xy > theBtn.Text = e.X.ToString & " : " & e.Y.ToString 'to get an idea of what is happening. > End Sub >End Class >>