If Forms ("查询表").opened Then If e.Node.Level = 1 Then e.Form.DropDownBox.Value = e.Node.Text Dim tr As WinForm.TreeView Dim pd As WinForm.TreeNode tr = Forms("列名").Controls("TreeView1") pd = tr.SelectedNode.ParentNode Forms ("查询表").Controls("DropBox10").text = pd.Text 希望动态使用控件名 ,该控件名称为触发控件名称末尾加0,如果e.Form.DropDownBox名称是DropBox1,则控件名为 DropBox10。 e.Form.DropDownBox.CloseDropdown() End If End If
4楼
有点蓝 发表于:2024/9/27 9:48:00
Forms ("查询表").Controls(e.Form.DropDownBox.name & "0").text = pd.Text