Declare Function GetCursorPos Lib "user32" Alias "GetCursorPos" (lpPoint As POINTAPI) As Long
Private Type POINTAPI
X As Long
Y As Long
End Type
Private Declare Function GetCaretPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Sub Text1_KeyPress(KeyAscii As Integer)
Dim XPos As Long
Dim YPos As Long
XPos = GetTCursX
YPos = GetTCursY
Me.Caption = "X: " & XPos & " Y: " & YPos
End Sub
Public Function GetTCursX() As Long
Dim pt As POINTAPI
GetCaretPos pt
GetTCursX = pt.X
End Function
Public Function GetTCursY() As Long
Dim pt As POINTAPI
GetCaretPos pt
GetTCursY = pt.Y
End Function
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 11