mouse Move Application

함흥처사 2014.06.04 07:16:40 *: Public Class Form1
#Region "global variables"
Dim point As New System.Drawing.Point()
Dim X, Y As Integer

#End Region
#Region "GUI"



Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
If e.Button = MouseButtons.Left Then
point = Control.MousePosition
point.X = point.X - (X)
point.X = point.Y - (Y)
Me.Location = point

End If
End Sub
Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown
X = Control.MousePosition.X - Me.Location.X
Y = Control.MousePosition.Y - Me.Location.Y

End Sub
#End Region



End Class