Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding objects with validation programmatically
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00767882
Message ID:
00767892
Vues:
11
>Hi Tom,
>
>Look at AddObject () or NewObject () to add a new control in the form. The control you add should be a class that can read the validation rule and validate it at runtime.
>
>HTH
>
>>I have a form to which I want to programmatically add some objects, based on a configuration table. My table specifies information about the object, including an expression for validation.
>>
>>How can I add my object programmatically to the form and specify a validation rule for it?
>>
>>I'm sure this must be simple and I'm missing something obvious. I did it in FP2.6.

----
Merci, Sylvain,

So I guess I need a special class of my textbox, for example, with a new property called, for example "ValidExp". Then, in my VALID method I would put:
return eval(this.ValidExp)
Then I would add it to my form with:
MyForm.AddObject("txt1", "SpecialTextboxClass")
loTxt1 = MyForm.txt1
loTxt1.ValidExp = lcValidationExpression
Is that it?

-- Tom
Tom Green in Montreal
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform