以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  下拉窗口再打开时,复选框还能再根据Dropbox内容恢复勾选吗?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=73904)

--  作者:bagih
--  发布时间:2015/8/28 20:37:00
--  下拉窗口再打开时,复选框还能再根据Dropbox内容恢复勾选吗?

下拉窗口再打开时,复选框还能再根据Dropbox内容恢复勾选吗?

 

下拉菜单展开前代码

Dim lb As WinForm.CheckedListBox = e.Form.Controls("CheckedListBox1")
lb.ComboList = DataTables("表A").GetComboListString("业务员")
e.Form.baseform.Width = e.Form.DropDownBox.Width

 

 

关闭后代码

Dim s As String
Dim l As WinForm.CheckedListBox = e.Form.Controls("CheckedListBox1")
For Each Index As Integer In l.CheckedIndices
    If s > "" Then
        s = s & ","
    End If
    s = s & "\'" & l.Items(Index) & "\'"
Next

If s > "" Then
       Forms("父窗口").Controls("DropBox1").text = s
End If


--  作者:大红袍
--  发布时间:2015/8/30 11:31:00
--  

展开的时候,

 

Dim ary() As String = e.Form.DropDownBox.Value.Split(",")
Dim l As WinForm.CheckedListBox = e.Form.Controls("CheckedListBox1")
For i As Integer = 0 To l.Items.Count - 1
    If array.indexof(ary, "\'" & l.Items(i) & "\'") >= 0 Then
        l.SetItemChecked(i, True)
    End If
Next