-- 作者:newbeehh
-- 发布时间:2012/11/20 15:56:00
-- [求助]多级多选能不能通过菜单方式搭建?
如题:
下方的代码根本不知道怎么操作!怎么建1个窗口……
1、新建一个窗口,名为“窗口1”,窗口类型设置为“DropDownForm”。
2、窗口中插入一个TreeView(目录树)控件和一个Button(按钮)。
3、窗口的AfterLoad事件设置为:
Dim s As String = e.Form.DropDownBox.Value Dim nms As new List(of String) Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1") If s > "" Then nms.AddRange(s.Split(",")) End
If For Each nd As WinForm.TreeNode In trv.AllNodes nd.Checked = nms.Contains(nd.text) Next
4、确定按钮的代码设置为:
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 & "," & nd.Text End If Next e.Form.DropDownBox.Value = s.trim(",") e.Form.DropDownBox.CloseDropdown
5、最后将项目事件AfterOpenProject的代码设置为:
Tables("表A").Cols("第一列").DropForm = "窗口1"
|