递归遍历Form中的所有控件

void printControls(Object o,str name)

{

    FormBuildControl  formBuildControl;

    int i;

    ;

 

 

    setprefix( "Group :" + name );

    for (i=1;i<=o.controlCount(); i++)

    {

        formBuildControl = o.controlNum(i);

        name = element.control(formBuildControl.id()).name();

        info( int2str(formBuildControl.id()) + ' ' + name );

 

        if (formBuildControl.isContainer())

            this.printControls(formBuildControl,name);

    }

}

posted @ 2011-12-17 20:44  perock  阅读(1103)  评论(0编辑  收藏  举报