[Closed] Getting location from DotNet textBox
Just wondering how I can get the position index where the user is current typing with a dotNet textBox? I’m guessing I have to use GetCharIndexFromPosition pt ? I’m pretty new with dotnet, so I’m still trying to get a hang of it.
<textbox>.selectionStart
Note that this does not necessarily contain the exact caret position (be darned if I can find that).
If no text is selected, then this contains the caret position.
If text -is- selected, then this contains the starting position of that selection. However, whether the caret is at that same position depends on whether they selected from the right to the left (then it is), or from the left to the right (then it isn’t).
This is a bit semantical, however, as pressing any new letter to drop in text will replace the entire selected text starting at selectionStart anyway.