Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Special K
Message
 
 
To
20/03/1998 12:32:59
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00086017
Message ID:
00086044
Views:
22
>>>>To expand a bit on Ed's response<g>, here is the code that would work in the Click():
>>>>
>>>>If Len(This.Value) = 0
>>>> keyboard "{HOME}"
>>>>Endif
>>>
>>>Probably more precize way is to code Text.Gotfocus event:
>>>keyboard '{END}'
>>>keyboard '{SHIFT+HOME}'
>>>now Format property can be cleaned up
>

I don't so<s>. The gotfocus() will not fire while the cursor is in the TextBox - not preventing the user from clicking in the textbox - allowing the user to start text entry somewhere else other than the beginning. You need to be careful with this stuff as you do not want to disturb normal Windows behavior. Thats why I have the check for Len() = 0. Otherwise, you have to let the user click around to change things. Other checks could be required in the KeyPress() - but that would have to be on a case by case basis. Usually, a well constructed inputmask addresses these issues.

In regards to the above code, it could be shorted as follows:

keyboard "{CTRL+END}"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform