If Forms("窗口1").Opened Then Dim trv As WinForm.TreeView = forms("窗口1").controls("TreeView1") If trv.SelectedNode IsNot Nothing AndAlso trv.SelectedNode.Level = 1 Then e.DataRow("第一列") = trv.SelectedNode.ParentNode.text e.DataRow("第二列") = trv.SelectedNode.text End If End If