以文本方式查看主题
- Foxtable(狐表) (http://foxtable.com/bbs/index.asp)
-- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2)
---- [求助]遍历窗口中的每个页面中的按钮 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=117207)
|
-- 作者:liuyixin662
-- 发布时间:2018/4/8 20:09:00
-- [求助]遍历窗口中的每个页面中的按钮
老师你好,求助遍历窗口中的每个页面中的按钮代码语句,即如何获取对应页面的按钮名,谢谢!!
|
-- 作者:有点甜
-- 发布时间:2018/4/8 22:39:00
--
参考代码
Dim tab As WinForm.TabControl \'= e.form.controls("TabControl1") For Each p As WinForm.TabPage In tab.tabpages For Each c As object In p.Children msgbox(c.name) Next Next
|
-- 作者:liuyixin662
-- 发布时间:2018/4/13 16:00:00
--
此主题相关图片如下:提取页面按钮名.bmp

|
-- 作者:有点甜
-- 发布时间:2018/4/13 16:02:00
--
Dim tab As WinForm.TabControl \'= e.form.controls("TabControl1") For Each p As WinForm.TabPage In tab.tabpages
If p.Text = "应付款按年汇总" Then For Each c As object In p.Children msgbox(c.name) Next
End If Next
|
-- 作者:liuyixin662
-- 发布时间:2018/4/13 16:56:00
--
以下是引用有点甜在2018/4/13 16:02:00的发言:
Dim tab As WinForm.TabControl \'= e.form.controls("TabControl1") For Each p As WinForm.TabPage In tab.tabpages
If p.Text = "应付款按年汇总" Then For Each c As object In p.Children msgbox(c.name) Next
End If Next 不是本页面的所有控件都显示出来了,而且我是要取得本页面的 按钮名
[此贴子已经被作者于2018/4/13 16:58:44编辑过]
|
-- 作者:有点甜
-- 发布时间:2018/4/13 17:16:00
--
Dim tab As WinForm.TabControl = e.form.controls("TabControl1") For Each p As WinForm.TabPage In tab.tabpages If p.Text = "应付款按年汇总" Then For Each c As object In p.Children If typeof c Is winform.button Then msgbox(c.name) End If Next End If Next
|
-- 作者:liuyixin662
-- 发布时间:2018/4/13 19:29:00
--
谢谢老师
|