Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Enumerating objects
Message
From
11/02/1999 10:03:47
 
 
To
11/02/1999 10:00:20
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00186491
Message ID:
00186496
Views:
17
>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 Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform