Dim tr As WinForm.TreeView = e.Form.Controls("TreeView1") tr.BuildTree("表4", "类别|项目") Dim s As String = e.Form.DropDownBox.Value Dim nms As new List(of String) Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1") If s > "" Then nms.AddRange(s.Split(",")) End If For Each nd As WinForm.TreeNode In trv.AllNodes nd.Checked = nms.Contains(nd.text) Next