递归遍历窗体控件 设置字体大小FontSize identifierstr hasObjectMethod

void SetControls(Object o)
{
    FormBuildControl  formBuildControl;
    SysDictClass    sysDictClass = new SysDictClass(o.handle());
    int i;
    ;

    if (  sysDictClass.hasObjectMethod(identifierstr("FontSize")))
        o.fontSize(20);
    if ( sysDictClass.hasObjectMethod(identifierstr("LabelFontSize")))
        o.LabelFontSize(20);
    for (i=1;i<=o.controlCount(); i++)
    {
        formBuildControl = o.controlNum(i);
         if (formBuildControl.isContainer())
            this.SetControls(formBuildControl);
    }
}

posted @ 2011-12-19 17:06  perock  阅读(332)  评论(0编辑  收藏  举报