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

Selecting all the text in a text box

Status
Not open for further replies.

Grounded

Technical User
Feb 26, 2003
27
US
When i click in a text box the first time i would like all the text in the cell selected (so that the user can simply start typing to replace all the text if they choose). when the user clicks the second time i'd like them to be able to edit where they click. This functionality is similar to the default functionality in Excell.

Thanks,

iz
 
iz,

Try [Tab] into the Textbox.

:)

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
i think if you use the tab instead of the mouse to go between boxes it selects the whole thing..

Durible Outer Casing to Prevent Fall-Apart
 
Use the TextBox.SelStart and TextBox.SelLength properties of the Text control.

TextBox.SetFocus
TextBox.SelStart = 1
TextBox.SelLength = Len(TextBox.Text)

This should help you.
 
Take a look at menu Tools -> Options, tab Keyboard, right pane (something like field behaviour on entry)
The spelling may be different as I don't use an english version of office.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top