define Class ObjectScanner as Custom procedure do_the_thing lParameters oControl ** Input control handling here at subclass level ***Once you dropped it to the form procedure go_all_over LPARAMETERS ParentContainer LOCAL i,oControl FOR each oControl in ParentContainer.Controls DO case CASE oControl.baseclass=="Pageframe" FOR i = 1 to oControl.Pagecount this.go_all_over(oControl.Pages(i)) NEXT CASE oControl.baseclass=="Container" this.go_all_over(oControl) CASE oControl.baseclass=="Grid" FOR i = 1 to oControl.columncount this.go_all_over(oControl.columns(i)) NEXT OTHERWISE this.do_the_thing(oControl) ENDCASE NEXT this.do_the_thing(ParentContainer) enddefineYou turn it into custom class in some vcx of yours (from this code you create visual class) and then drop on form you want to handle. Once in form as custom object you can call it's main method and pass object reference of cobject containing other objects (form, pageframe, container etc)
**place holder method 'do_the_thing' on subclassed instance of object scanner on the form; lparameters oControl if ... oControl.enabled = .t. else oControl.enabled = .f. endifTo start it all you call main method ;
Thisform.ObjectScanner1.go_all_over(thisform) **or Thisform.ObjectScanner1.go_all_over(thisform.Pagerframe1) **or Thisform.ObjectScanner1.go_all_over(thisform.SomeContainer)HTH