以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 多选目录树,如何实现此例? (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=92734) |
||||
-- 作者:fox-man -- 发布时间:2016/11/11 12:16:00 -- 多选目录树,如何实现此例?
|
||||
-- 作者:有点蓝 -- 发布时间:2016/11/11 14:07:00 -- If e.Node.Level = 0 Then \'如果是顶层节点 Return \'则返回 Else Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1") Dim ids As String Dim nd As WinForm.TreeNode Dim pd As WinForm.TreeNode For Each nd In e.node.allNodes \'清除子节点的选中标记 nd.Checked = False Next pd = e.Node.ParentNode Do While pd IsNot Nothing \'清除父节点的选中标记 pd.Checked = False pd = pd.ParentNode Loop For Each nd In trv.AllNodes pd = nd Do While pd IsNot Nothing If pd.Checked Then If ids > "" Then ids= ids & "," End If ids = ids & nd.DataRow("编号") Exit Do Else pd = pd.ParentNode End If Loop Next If ids > "" Then Tables("表B").Current("编号") = IDS End If End If
|
||||
-- 作者:fox-man -- 发布时间:2016/11/11 14:21:00 -- 谢谢 |