Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding objects with validation programmatically
Message
De
20/03/2003 07:30:22
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00767882
Message ID:
00767985
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

That should work. I would do it exactly the way you explain it.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform