Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Textbox control.
Message
De
09/09/1998 20:34:55
 
 
À
09/09/1998 15:11:51
Sergio Ortiz
Tek Services Group, Llc
Hollywood, Floride, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00134740
Message ID:
00134857
Vues:
14
>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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform