24-11-13, 02:16 AM
كود :
Dim b As Boolean = False
Dim x, y As Short
Private Sub Panel1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseDown
x = e.X
y = e.Y
b = True
End Sub
Private Sub Panel1_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseMove
If b Then
Me.Left = MousePosition.X - x
Me.Top = MousePosition.Y - y
End If
End Sub
Private Sub Panel1_MouseUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseUp
b = False
End Sub
