If Forms("窗口1").Opened Then Dim tr As WinForm.TreeView Dim nd As WinForm.TreeNode tr = Forms("窗口1").Controls("TreeView1") nd = tr.Nodes.Add("新节点") tr.SelectedNode = nd tr.Select() tr.BeginEdit()End If
只有在本窗口和控件的事件中,才能用e.form,否则都要Forms("窗口名")
建议看看:
http://www.foxtable.com/help/topics/1854.htm