Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using a Control (or a container) to validate its content
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00030015
Message ID:
00030028
Vues:
55
>>>>>>>>>I am trying to create my own custom controls using both the Control and Container object. I am using the LostFocus event to validate my custom control by setting the focus back into the control if it is not valid. This almost works, but like usual VFP has to spoil things. Checkboxes can still be checked outside of my control and the Form can be closed even if the data is invalid.
>>>>>>>>>
>>>>>>>>>Does anyone have a sure solution to the VALIDATION OF A CONTROL OR CONTAINER?????
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>TIA,
>>>>>>>>>Peter
>>>>>>>>>
>>>>>>>>>btw, my control is a date picker control.
>>>>>>>>
>>>>>>>>Yes, use the VALID event, not LOSTFOCUS.
>>>>>>>>
>>>>>>>>Vlad
>>>>>>>
>>>>>>>BUT, a Container and Control object do not have Validate events.... So I can,t use that event!!!!
>>>>>>>Peter
>>>>>>
>>>>>>But the objects contained in the control have Valid events. Why can't you use them?
>>>>>>
>>>>>>Vlad

cut >>

>>Why you don't fill the others sections of your date field with something valid?
>>
>>If the user take the 'Year' part in your date picker you can fill the day and month with '01' if those parts are empty...?
>Because I don't want to guess on what the user would have typed. I want to inform the use that he/she needs to fill in the missing data. The date control is just one place that I want to use this technique.

I don't know how you can do that without a valid event.

I think that you must add a command button to your container and do the validation on the click event of this button!
If we exchange an apple, we both get an apple.
But if we exchange an idea, we both get 2 ideas, cool...


Gérald Santerre
Independant programmer - internet or intranet stuff - always looking for contracts big or small :)
http://www.siteintranet.qc.ca
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform