Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
IsNumeric - VFP analogue?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00307922
Message ID:
00308498
Vues:
41
Nadya,

Like I suggested in my last message, you build a container with a fixed number of textboxes (your SQL line is limited in length anyway so there should be not problem if there is a maximum number of values). You put the textboxes in the container and set them to have no borders. You arrange the textboxes so their edges meet one above the other (you'll need to arrange them before you turn off their borders).

You give the container a method named ValidateInput and a property named TextInputMask. In the Init event of the container you set the InputMask of each textbox to the same value as the TextInputMask property of the container. From the Valid of each textbox you call the ValidateInput method of the container.

Now, nothing has been done yet about the code that does the validation, that will vary from one use to another. But you write your validation code in the ValidateInput method of the container. Each textbox can pass its value as an argument to the method and receive a T/F return from it.

Now all you have to do is put the container in a form, size things to the size you want them, write the valid code in the ValidateInput method and set the TextInputMask of the container and you're done.

If you want to get really fancy you could give the container a TextboxCount property and use that the add the textboxes (from a class that has the call to ValidateInput in its valid) at runtime according to the value in TextboxCount.

IOW, instead of working very hard to get an edtibox to act in a fashion it is not designed for, build a control that is designed to work exactly as you want it to.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform