以文本方式查看主题

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

--  作者:riyuan
--  发布时间:2014/9/6 11:02:00
--  checklistbox
请教判断没有任何选择项目,按钮enabled为假,哪怕有一个选择按钮enabled为真

    Dim cst As WinForm.CheckedListBox = e.Form.Controls("CheckedListBox1")
 For idx As Integer = 0 To cst.Items.Count - 1

 If e.Checked Then
               e.Form.Controls("button1").Enabled=True
Else
e.Form.Controls("button1").Enabled=False
Exit For
End If
Next
图片点击可在新窗口打开查看此主题相关图片如下:大.jpg
图片点击可在新窗口打开查看

--  作者:有点酸
--  发布时间:2014/9/6 22:19:00
--  
Dim cst As WinForm.CheckedListBox = e.Form.Controls("CheckedListBox1")
Dim cnt As Integer
For idx As Integer = 0 To cst.Items.Count - 1
    If e.Checked Then
        cnt = cnt + 1
    End If
Next
e.Form.Controls("button1").Enabled = (cnt > 0)