본문 바로가기

VB.NET

커서의 위치를 취득하는 방법

반응형

현재 커서의 위치를 취득하는 방법이다.

 

네임스페이스: System.Windows.Forms
어셈블리: System.Windows.Forms(System.Windows.Forms.dll)

 

Private Sub MoveCursor()
   ' Set the Current cursor, move the cursor's Position,
   ' and set its clipping rectangle to the form.

   Me.Cursor = New Cursor(Cursor.Current.Handle)
   Cursor.Position = New Point(Cursor.Position.X - 50, Cursor.Position.Y - 50)
   Cursor.Clip = New Rectangle(Me.Location, Me.Size)
End Sub

 

이와같은 함수로 현재 커서의 위치를 취득할수 있다.

반응형