General information
Category:
Forms & Form designer
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
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