以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- checklistbox (http://foxtable.net/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 |
-- 作者:有点酸 -- 发布时间: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) |