Foxtable(狐表)用户栏目专家坐堂 → 在窗口中多选时,如何能目录树分级显示?


  共有5504人关注过本帖树形打印复制链接

主题:在窗口中多选时,如何能目录树分级显示?

帅哥哟,离线,有人找我吗?
lsy
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:5246 积分:33163 威望:0 精华:8 注册:2013/1/17 21:28:00
  发帖心情 Post By:2013/5/24 7:53:00 [显示全部帖子]

下拉框选值,反映到目录树:

Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
For Each nd As WinForm.TreeNode In trv.AllNodes
    If e.Sender.Text.Contains(nd.Name) Then
        nd.Checked = True
    End If
Next
trv.ExpandAll()

 

目录树选值,反映到下拉框 

Dim trv As WinForm.TreeView = e.Sender
Dim txt As String
For Each nd As WinForm.TreeNode In trv.AllNodes
    If nd.Level = 1 Then
        If nd.Checked = True Then
            txt = txt & "," & nd.Name       
        End If
    Else
        nd.Checked = False
    End If
Next
If txt > "" Then
    txt = txt.Trim(",")
End If
e.Form.Controls("CheckedComboBox1").Text = txt
 

[此贴子已经被作者于2013-5-24 10:19:09编辑过]

 回到顶部