Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changing default cursor position when textbox gets focus
Message
From
26/02/1999 15:40:55
Jonathan Cochran
Alion Science and Technology
Maryland, United States
 
 
To
26/02/1999 15:22:58
Chris Crachiolo
Blackmoor Associates Incorporated
New York City, New York, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00192131
Message ID:
00192140
Views:
27
Instead of stuffing the keyboard buffer, you could look at using the SelStart property of the textbox.

>VFP 5.0a: Is there any way to change the default cursor position when the user tabs into a text box control?
>
>I've got a bound text box control that accepts a numeric value. I want it to display the number with commas, so I set the InputMask to "999,999,999" which works fine, except that when the form runs and a new record is being added, the controls displays a zero at the rightmost position when the user starts typing (at the default cursor position, which is in the middle), and unless extra effort is made, it becomes part of the number. For example, if the user simply enters "22" it becomes "220" unless the zero is deleted. The only easy way I can see to avoid this is to omit the InputMask, but then I lose my commas.
>
>Is there a way around this, other than creating a text-box subclass and writing code to eliminate the input mask and then restoring it after the entry is complete? I would rather avoid this, since I would then be unable to drag-and-drop from the data enviroment in these cases (I think).
>I suppose I could also force the cursor into the desired position by stuffing the keyboard buffer, but this is also something I want to avoid.
>
>Thanks in advance.
Previous
Reply
Map
View

Click here to load this message in the networking platform