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.comNever mistake having a career with having a life.