Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can i set the position of the caret in a textbox?

Status
Not open for further replies.

Blitz

Technical User
Jul 7, 2000
171
US
Currently when i select all the text in a textbox (me.textbox1.selectall ) the caret ends up at the very end of the text. I would like the caret to end up at the beginning of the selected text but i cant find anyway to set the caret position. Thanks for any help.
 
hi
Me.TextBox1.SelectionStart = 0
Me.TextBox1.SelectionLength = 1 'will select only 1 letter
Me.TextBox1.Focus()

it will select the first letter in the textbox
but if u want to get the caret in the first position and also select the whole text then i don't know why you want to implement that b/c its not the selectall or selection is designed
Nouman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top