以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]窗口如何写“所有复选框均未选中”这种状态的判断语句?  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=35693)

--  作者:comnets
--  发布时间:2013/6/30 16:48:00
--  [求助]窗口如何写“所有复选框均未选中”这种状态的判断语句?
[求助]窗口如何写“所有复选框均未选中”这种状态的判断语句?
--  作者:lsy
--  发布时间:2013/6/30 16:59:00
--  
Dim i As Integer
For Each c As WinForm.Control In e.Form.Controls
    If TypeOf c Is WinForm.CheckBox Then
        Dim ctl As WinForm.CheckBox = c
        If ctl.Checked Then
            i + = 1
        End If
    End If
Next
If i > 0 Then
    MessageBox.Show("有的复选框已选中")
Else
    MessageBox.Show("所有复选框都未选中")
End If

--  作者:comnets
--  发布时间:2013/6/30 18:33:00
--  
非常感谢!