>LPARAMETERS oObj, cMethod >LOCAL nX, oComp >DO CASE > >* If this object has the method, run it >CASE PEMSTATUS(oObj, cMethod, 5) > EVALUATE ([oObj.] + cMethod + "()") > >* If this doesn't have a baseclass we can get to... (VFPSkins has this issue) >CASE PEMSTATUS(oObj, [BaseClass], 2) > *...we don't know to do > >* If this has a Controls array, go thru each component >CASE PEMSTATUS(oObj, [ControlCount], 5) AND oObj.ControlCount > 0 > FOR nX = 1 TO oObj.ControlCount > oComp = oObj.Controls[nX] > THISFORM.RunAll(oComp, cMethod) > ENDFOR > >* If this is a Grid, go thru each column >CASE oObj.BaseClass = [Grid] AND oObj.ColumnCount > 0 > FOR nX = 1 TO oObj.ColumnCount > oComp = oObj.Columns[nX] > THISFORM.RunAll(oComp, cMethod) > ENDFOR > >* If this is a PageFrame, go thru each page >CASE oObj.BaseClass = [Pageframe] AND oObj.PageCount > 0 > FOR nX = 1 TO oObj.PageCount > oComp = oObj.Pages[nX] > THISFORM.RunAll(oComp, cMethod) > ENDFOR > >* If we got here, we can't do anything with this object >ENDCASE >You can use the OBJECTS collection and avoid repeating the code for containers, grids, pageframes.
Lparameters toObject Local loChildObject As Control If Pemstatus(m.toObject, [MouseWheel], CON_PEMSTAT_DEFINED) Bindevent(m.toObject, [MouseWheel], This, [MouseWheel], 1) Endif If Pemstatus(m.toObject, [Objects], CON_PEMSTAT_DEFINED) For Each m.loChildObject In m.toObject.Objects This.ctl32_BindMouseWheel(m.loChildObject) Endfor EndifCarlos