Advertisement
4_2005-2006 Miscellaneous #169658

get / set cursor position

basically this is a quick function to show you how to set or get the position of your mouse cursor.

AI

AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Source Code
original-source
Private Function setCursor(ByVal X As Integer, ByVal Y As Integer)<br>
If Not X = Nothing And Not Y = Nothing Then<br>
Dim curPoint As New Point(0, 0)<br>
curPoint.X = X<br>
curPoint.Y = Y<br>
Cursor.Position = curPoint<br>
End If<br>
End Function<br><br>
Public Function getCursor()<br>
Dim curPoint As New Point(0, 0)<br>
curPoint.X = Cursor.Position.X<br>
curPoint.Y = Cursor.Position.Y<br>
Return curPoint<br>
End Function<br>
'USAGE:<br>
'to get cursor position:<br>
MsgBox(getCursor.x & ", " & getCursor.y)<br>
'to set cursor position:<br>
setCursor(x coordinate, y coordinate)<br><br>
<b>i hope this snippet has helped anyone out there who is strugling with cursor functions.</b>
Original Comments (3)
Recovered from Wayback Machine