|
Определение координат позиции курсора в TextBox |
|
|
Добавьте на форму элемент TextBox. 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
|
|
|
|
|
|
|