以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  返回某一类控件的问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=103647)

--  作者:rjh4078
--  发布时间:2017/7/13 14:03:00
--  返回某一类控件的问题
dim s as string
For Each c As WinForm.Control In e.form.Controls
                If Typeof e.sender Is WinForm.CheckBox Then
                    If e.sender.name.startswith("fl") Then
                        s=s & c.name
                    End If
                End If
            Next
message.show(s)
返回的为什么是所有的控件 ?
[此贴子已经被作者于2017/7/13 14:03:23编辑过]

--  作者:有点甜
--  发布时间:2017/7/13 14:06:00
--  

改成

 

If Typeof c Is WinForm.CheckBox Then


--  作者:rjh4078
--  发布时间:2017/7/13 14:20:00
--  
如果要调用c的text怎么调用  我直接调用 ---------------------------
错误
---------------------------
编译错误:“text”不是“WinForm.Control”的成员。



错误代码:s=c.text & s
---------------------------
确定   
---------------------------


--  作者:有点甜
--  发布时间:2017/7/13 14:34:00
--  

For Each c As WinForm.Control In e.form.Controls

 

改成

 

For Each c As Object In e.form.Controls