Dim tr As WinForm.TreeView Dim pd As WinForm.TreeNode tr = Forms("窗口1").Controls("TreeView1") If tr.SelectedNode Is Nothing Then msgbox("请选择节点") Else pd = tr.SelectedNode.ParentNode If pd Is Nothing Then tr.Nodes.Add("新节点") Else pd.Nodes.Add("新节点") End If End If