Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to show + or - with numeric textbox?
Message
 
À
24/02/2000 02:13:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00336230
Message ID:
00336800
Vues:
28
>>Hi Al,
>>
>>Since it's read-only, would something like this do the trick for you?
>>
>>*in textbox.refresh:
>>This.InputMask = iif(This.Value > 0, '+999999', '999999')
>>
>>>A numeric textbox will always show a - (minus sign) before a negative number. However, I would like to explicitly show a + (plus sign) when the number is positive, and neither when it is zero.
>>>
>>>I couldn't find an InputMask or Format property that would do this. Am I missing something? BTW VFP 5.0a.
>>>
>>>TIA.
>
>Brilliant - works great. The only tiny quibble is that the "+" sign appears in a fixed position to the left of the number (as opposed to the "-" sign which is always right up against the number, regardless of width).
>
>But for sure, it's close enough for the girls I wish I went with.
>
>Thanks.


Re: quibble

You can make it a little more sophisticated with a case statement or a bunch of embedded IIF statements. Basically, if the value is positive, then: If the value is less than 10, use "+9"; less than 100, use "+99"; etc..

This should stick the sign up against the number.

Take care,
Joe
Joseph C. Kempel
Systems Analyst/Programmer
JNC
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform