>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