Community discussion forum

TextBox

  • 1 year ago

    Is there anyway I can tell where the blinking cursor is located (character-wise) in the text of a textbox?

  • 1 year ago

    Hi,

    You can find the position of the caret by using the textbox's SelectionStart property, eg.

    Dim theValue As Integer = TextBox1.SelectionStart

  • 1 year ago

     

    Thanks ... In the Textbox1_Click event I used caretPosition = Textbox1.SelectionStart and it works. The problem I had with it at first was using the code in the Enter event instead of the Click event. That made all the difference. Thanks a million.

Post a reply

Enter your message below

Sign in or Join us (it's free).

Want to stay in touch with what's going on? Follow us on twitter!