Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Format Property M
Message
De
13/09/1996 11:49:18
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00007759
Message ID:
00007764
Vues:
26
>Does anyone have experience using this format for a text box? You are supposed to be able to have multiple input masks delimited by commas, according to documentation, by I can't find any examples of how to use it.
>
>I'm trying to show input mask (999) 999-9999 for a (char) phone number, but nothing if the field is blank. The phone format 'R' works fine when a number exists, but I can't suppress the format for a blank field. The empty formats "( ) - " don't look good in a grid, so I'd like to suppress them. Any ideas?
>
>Thanks

Hi Bruce,

Maybe try setting the input mask based on the contents of the field. Kind of a dynamic input mask. You could use the textbox InteractiveChange() event to set and clear the mask. For example:

Try this code in your TEXTBOX InteractiveChange() event:

LOCAL nPosition
IF EMPTY(THIS.Value)
THIS.Format = ""
THIS.InputMask = ""
THIS.Value = ""
ELSE
IF EMPTY(THIS.Format)
m.nPosition = THIS.SelStart
THIS.Format = "R"
THIS.InputMask = "(999) 999-9999"
THIS.SelStart = m.nPosition + 1
ENDIF
ENDIF

"M" is used in the Format property to specify multiple values that the control can be set to, not to specify multiple input masks. Try the following to demonstrate how this works:

1) Create a textbox on a form.
2) Set the following properties:
Format = M
InputMask = Apple,Orange,Banana
3) Run the form.
4) Press the spacebar in the textbox.

-Doug-
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform