下拉框选值,反映到目录树:
Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
For Each nd As WinForm.TreeNode In trv.AllNodes
If e.Sender.Text.Contains(nd.Name) Then
nd.Checked = True
End If
Next
trv.ExpandAll()
目录树选值,反映到下拉框:
Dim trv As WinForm.TreeView = e.Sender
Dim txt As String
For Each nd As WinForm.TreeNode In trv.AllNodes
If nd.Level = 1 Then
If nd.Checked = True Then
txt = txt & "," & nd.Name
End If
Else
nd.Checked = False
End If
Next
If txt > "" Then
txt = txt.Trim(",")
End If
e.Form.Controls("CheckedComboBox1").Text = txt
[此贴子已经被作者于2013-5-24 10:19:09编辑过]