Dim cmb1 As WinForm.CheckedComboBox
Dim cmb2 As WinForm.CheckedComboBox
cmb1 = Forms("通用查询").Controls("HSDW")
cmb2 = Forms("通用查询").Controls("BMLX2")
Dim str2 As String = Forms("通用查询").Controls("BMLX1").text
Dim trv As WinForm.TreeView = Forms("窗口下拉模板").Controls("TreeView1")
trv.BuildTree("部门档案", "组织|部门名称", "组织 In ( '" & cmb1.ComboList.replace("|", "','") & "') and " & str2 & " In ( '" & cmb2.ComboList.replace("|", "','") & "')")
通用查询窗口有个下拉窗口,引用的是"窗口下拉模板",想根据查询窗口的条件来筛选"窗口下拉模板"中显示的内容,有什么办法实现
做了个下拉框的全选,下面把所有节点内容都选过来了,怎样只选末级
Dim s As String = ""
Dim trv As WinForm.TreeView = Forms("窗口下拉模板").Controls("TreeView1")
For Each nd As WinForm.TreeNode In trv.ALLNodes
If nd.Level = 1 Then
nd.Checked = True
End If
s = s & "," & nd.Text
Next
Forms("窗口下拉模板").DropDownBox.Value = s.trim(",")
此主题相关图片如下:微信图片_20241028170552.png
For Each nd As WinForm.TreeNode In trv.ALLNodes
If nd.Level = 1 Then
nd.Checked = True
s = s & "," & nd.Text
End If
Next