>>>>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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only