Foxtable(狐表)用户栏目专家坐堂 → [求助] 想要引用 TabControl 页面子控件集合 Children 中的控件,这段代码怎么执行不了呢?


  共有1939人关注过本帖平板打印复制链接

主题:[求助] 想要引用 TabControl 页面子控件集合 Children 中的控件,这段代码怎么执行不了呢?

美女呀,离线,留言给我吧!
龙潭春早
  1楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:676 积分:4895 威望:0 精华:0 注册:2018/3/22 16:05:00
[求助] 想要引用 TabControl 页面子控件集合 Children 中的控件,这段代码怎么执行不了呢?  发帖心情 Post By:2020/9/15 17:50:00 [只看该作者]

想要引用 TabControl 页面子控件集合 Children 中的控件,这段代码怎么执行不了呢?

代码:

Dim tbp As WinForm.TabPage
Dim ctr As WinForm.Control
Dim btn As WinForm.Button

tbp = Forms("窗口1").Controls("TabControl").TabPages(2)

output.show("")

If tbp.Children.Count > 0 Then
    output.show("")
    For Each ctr In tbp.Children
        If Typeof ctr Is WinForm.Button Then
            btn = ctr
            output.show(btn.Name)
        End If
    Next
End If


 回到顶部