Dim s As String = "" Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1") For Each nd As WinForm.TreeNode In trv.AllNodes '如果只选择第二层节点,代码如何写? If nd.Checked Then s = s & vbcrlf & nd.Text End If Next e.Form.DropDownBox.Value = s.trim() e.Form.DropDownBox.CloseDropdown