Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to check for existence of a control on a form
Message
De
08/11/1999 20:33:47
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00288347
Message ID:
00288802
Vues:
17
>Gerard,
>Christof's suggestion was correct. However, if the control is .Null, his code will give you .T. back but your base class code will still bomb. You'll need to check to see if the value is .Null, OR, and simpler, check to see if the the control NAME is type "C"
>
>IF type('thisform.mycontrol') =="O" AND !isnull(thisform.mycontrol)
>...
>
>or
>
>IF type('thisform.mycontrol') =="O" AND type('thisform.mycontrol.name') == "C"
>...
>
>
>HTH
>Barbara
>
>>I have some code in my Base Class which operates on form controls. Sometimes, for certain forms, these controls wont exist. Is there a way of checking for the existence of a control on a form .i.e.
>>
>>if ThisForm.Mycontrol exists
>> do....
>>else
>> do ....
>>endif
>>
>>Thsi code would want to be able to check for any control, i.e. Txtbox, Shape, Gris etc.
>>
>>Regards,
>>
>>Gerard


I prefer Jim Booth's way. < g >

IF type('thisform.mycontrol.Name') =="C"
DO ...
ELSE
DO ...
ENDIF
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform