Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Enumerating objects
Message
De
11/02/1999 12:24:14
 
 
À
11/02/1999 10:03:47
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00186491
Message ID:
00186624
Vues:
18
>>I've got a form with several buttons on it. From time to time, other programmers and and remove buttons from this form. I'm trying to write a method for the form that will simply run through each button on the form and enable/disable it. I don't want to have to change the code for that method each time. I'd rather have code that will enable/disable any button on that form. I've been trying to use FOR EACH btn IN THISFORM, but VFP complains that you cannot enumerate THISFORM. Any suggestions?
>
>You may use FOR EACH oControl IN Thisform.Controls
>and then check for oControl.Baseclass="Commandbutton" in this loop.
>If you want to treat all buttons equally, then you may use Thisform.SetAll(,,"Commandbutton")

Edward:

Thank you very much. Your solution works perfectly.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform