Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select entire value in textbox with mouse.
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Select entire value in textbox with mouse.
Miscellaneous
Thread ID:
00257862
Message ID:
00257862
Views:
57
Over time there have been many threads asking the question of how to select the entire value in a textbox when clicked on with the mouse. Most replies revolved around the .SelStart and .SelLength properties in the .Click Event.

I read a tip in FoxPro Advisor that, IMO, is a better way and thought I'd post it for those that missed it.

.SelectOnEntry = .T.
Put DODEFAULT() in the .GotFocus Event of the textbox

This will cause the entire value in the textbox to be selected when TABbing in. Also, if the user clicks on the textbox once the entire value will be selected, and if they click on it again the cursor will be positioned where clicked. More desirable functionality, IMO, and my users like it already.

Cheers,
Colin Magee
Team Leader, Systems Development
Metroland Media Group Ltd.
Mississauga, Ontario, Canada

cmagee@metroland.com

Never mistake having a career with having a life.
Next
Reply
Map
View

Click here to load this message in the networking platform