以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  groupbox  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=185464)

--  作者:1498351234
--  发布时间:2023/2/24 10:58:00
--  groupbox
老师好!
调用DLL后,能遍历到dll中有个groupBox1的控件,但是groupbox1里的控件看不见。如何让groupBox1能看见,或是遍历到也行?
以下是窗口AfterLoad的代码
Dim FormTest As new HxgcDeviceDemo.Form1
FormTest.TopLevel = False
FormTest.Parent = e.Form.Controls("Panel1").BaseControl
e.Form.Controls("Panel1").BaseControl.Controls.Add(FormTest)

For Each c As Winform.Control In e.Form.Controls
    msgbox(c.Name)      \'这里显示有 panel1 和 groupBox1
Next

--  作者:有点蓝
--  发布时间:2023/2/24 11:04:00
--  
For Each c As Winform.Control In e.Form.Controls
    msgbox(c.Name) \'这里显示有 panel1 和 groupBox1
    If TypeOf c Is WinForm.GroupBox Then
        Dim k As WinForm.GroupBox = c
        For Each c1 As Winform.Control In k.children
            msgbox(c1.Name) \'这里显示有 panel1 和 groupBox1
        Next
    End If 
    
Next