以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  获取控件名称为何报错。  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=48103)

--  作者:ndxfke
--  发布时间:2014/3/23 10:40:00
--  获取控件名称为何报错。
For Each wc As WinForm.Control In e.Form.Controls
    If typeof wc Is WinForm.TreeView Then
        wc.Name   

        \'Dim tv As WinForm.TreeView = wc
        \'tv.Name
        \'MessageBox.show(tv.Name)
    End If
Next


请大神帮纠正。

--  作者:lsy
--  发布时间:2014/3/23 11:13:00
--  
For Each wc As WinForm.Control In e.Form.Controls
    If TypeOf wc Is WinForm.TreeView Then
        Dim tv As WinForm.TreeView = wc
        MessageBox.show(tv.Name)
    End If
Next

--  作者:ndxfke
--  发布时间:2014/3/23 13:56:00
--  
我开始也是用的这段代码,发现报错。现在贴上你的,现在又OK了。
谢了!