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


  共有1941人关注过本帖树形打印复制链接

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

帅哥哟,离线,有人找我吗?
有点蓝
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106242 积分:540333 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/9/15 20:16:00 [显示全部帖子]

output.show(tbp.Children.Count) '有几个控件?

If tbp.Children.Count > 0 Then
    For Each ctr In tbp.Children
    output.show(ctr.name) ‘分别显示什么名称?
        If Typeof ctr Is WinForm.Button Then
            btn = ctr
            output.show(btn.Name)
        End If
    Next
End If

注意Children只是返回第一层控件,比如tabpage里有一个panel,panel有其它控件。Children只能返回panel,无法返回panel里面的控件的

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106242 积分:540333 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/9/15 23:19:00 [显示全部帖子]


 回到顶部