以文本方式查看主题

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

--  作者:LTHERO
--  发布时间:2017/11/13 18:41:00
--  checkedlistbox
Dim lst As WinForm.CheckedListBox
Dim v As new List(of String)
lst = Forms("测试").Controls("CheckedListBox1")

For i As Integer = 0 To lst.Items.Count -1
    If lst.GetItemChecked(i) = False Then v.Add(lst.Items(i))
    Tables("新表").Cols(lst.Items(i)).Visible = True
Next
请问一下老师,这段代码为什么执行完了之后是所有的列都隐藏了,明明是=false才加入的item(i)啊

--  作者:有点甜
--  发布时间:2017/11/13 20:39:00
--  

Dim lst As WinForm.CheckedListBox
\'Dim v As new List(of String)
lst = Forms("测试").Controls("CheckedListBox1")

For i As Integer = 0 To lst.Items.Count -1
    If lst.GetItemChecked(i) = False Then
        \'v.Add(lst.Items(i))
        Tables("新表").Cols(lst.Items(i)).Visible = True
    Else
        Tables("新表").Cols(lst.Items(i)).Visible = False
    End If
Next


--  作者:LTHERO
--  发布时间:2017/11/14 9:32:00
--  
问题解决了,原来是自己逻辑不清楚,感谢有点甜老师!图片点击可在新窗口打开查看