Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Textbox control.
Message
From
09/09/1998 20:34:55
 
 
To
09/09/1998 15:11:51
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00134740
Message ID:
00134857
Views:
13
>Hello everyone!
>
>Anybody knows how to make a textbox control behave like a ATM machine when entering a dollar amount.
>As you type the digits move from right to left.

Hi Sergio,

I assume your control source is numeric. If so, in the keypress event of the textbox, capture all keypresses that evaluate to numerics then assign the value of the keypress to the control's value. For example:
*-- myATMTextBox.Keypress
LPARAMETERS nKeyCode, nShiftAltCtrl

IF CHR(nKeyCode) $ "0123456789"
    WITH this
        .value = (10*.value)+ VAL(CHR(nKeycode))
    ENDWITH
    NODEFAULT
    RETURN
ENDIF
You will also want to ensure that your .alignment is right, and that your input mask eliminates all but numeric input.

regards,
Jim Edgar
Jurix Data Corporation
jmedgar@yahoo.com

No trees were destroyed in sending this message. However, a large number of electrons were diverted from their ordinary activities and terribly inconvenienced.
Previous
Reply
Map
View

Click here to load this message in the networking platform