Office中国论坛/Access中国论坛

标题: 如何得到当前窗体全部控件名称? [打印本页]

作者: 大熊    时间: 2002-4-26 00:32
标题: 如何得到当前窗体全部控件名称?
Dim ctl As Control

    For Each ctl In Me.Controls

        ctl.name '好像没有该属性
               OR
        ctl.Properties("Name"))'好像也不行啊!

    Next
作者: tmtony    时间: 2002-4-26 02:13
Dim ctl As Control

    For Each ctl In Me.Controls

        MsgBox ctl.Name
  
    Next
然后可用typeof判断控件类型,再使用其它各自特有的属性

作者: 大熊    时间: 2002-4-26 02:19
:),是我疏忽了!
作者: tmtony    时间: 2002-4-26 02:40
老马失蹄 :)

作者: 大熊    时间: 2002-4-26 02:43
不,年轻人犯错误,上帝也会原谅。:)




欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3