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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Placing cursor after selected text

Status
Not open for further replies.

JESTAR

Programmer
Feb 13, 2002
213
GB
Hi, I have a textbox which is searched for a string, the string is highlighted

Code:
TextBox.SelStart = InStr(TextBox.Text, strSeek) - 1
TextBox.SelLength = Len(strSeek)
TextBox.SetFocus

On a button_click() event, how do I deselect the text (sellenght = 0), then place the cursor after the selected text (selstart).

Thanks...
 
TextBox.SelStart = Len(Textbox.Text)

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
Nevermind figured it out:

Code:
TextBox.SelLength = TextBox.SelLength - Len(strSeek)
    TextBox.SelStart = TextBox.SelStart + Len(strSeek)
    TextBox.SetFocus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top