How can I know the position of the cursor into the TextBox?
Printable View
How can I know the position of the cursor into the TextBox?
The MouseMove event of the TextBox returns the cursor coordinates relativr to it. If you want to get the absolute position you can use the GetCursorPos API function or add the position of the TextBox and every parent to the coordinates.
Code:'Module
Public Type tCoord2D
x As Long
y As Long
End Type
Public Declare Function GetCursorPos Lib "user32" Alias "GetCursorPos" (lpPoint As tCoord2D) As Long
'Code
Dim Temp as tCoord2D
'Get position
GetCursorPos Temp
Caption = Temp.x & ", " & Temp.y
Yeah I Need To Know This So I Can Insert Text Where The Cursor Is At Please Email Me When Yall Figure It Out. <B>[email protected]<B>
I Found Out...
You Could Use The SelStart Property, Or You Could Also see The SelTexr Property