>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:
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.comNo trees were destroyed in sending this message. However, a large number of electrons were diverted from their ordinary activities and terribly inconvenienced.