Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Inputmask for numerics in grid column
Message
De
22/12/2004 10:06:33
 
 
À
21/12/2004 19:55:58
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Divers
Thread ID:
00971208
Message ID:
00971416
Vues:
25
I have a numeric column in a grid. I'd like the values to display using a value for inputmask of '9,999,999'.

However, the user can modify the data in this column, and the inputmask really screws things up when the user tries using the keyboard.


Leave the InputMask on the column as '9,999,999'. That way, all the text boxes that do not have focus will be formatted nicely.

Next, create a numeric text box class for use in your grid and drop it in to the appropriate column. Add a custom property called cOldInputMask to the class. This code in the GotFocus()
WITH This
  *** Save the original input mask
  .cOldInputMask = .InputMask
  *** Remove separators from input mask
  .InputMask = STRTRAN( .cOldInputMask, ',', '' )
  *** Perform The parent class behavior
  DODEFAULT()
ENDWITH
And this code in the LostFocus()
This.InputMask = This.cOldInputMask
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform