Foxtable(狐表)用户栏目专家坐堂 → 如何用目录树的节点形成组合框的列表值?


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

主题:如何用目录树的节点形成组合框的列表值?

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


加好友 发短信
等级:管理员 帖子:47448 积分:251054 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2012/8/24 14:50:00 [显示全部帖子]

Dim tr1 As WinForm.TreeView = e.Form.Controls("TreeView1")
Dim cb As WinForm.ComboBox = e.Form.Controls("ComboBox1")
'选取节点进行排序
Dim nms As New List(of String)
For Each nd As WinForm.treenode In tr1.nodes
    nms.add(nd.name)
Next
nms.sort()
cb.ComboList = String.Join("|", nms.Toarray)

 回到顶部
帅哥哟,离线,有人找我吗?
狐狸爸爸
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:管理员 帖子:47448 积分:251054 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2012/8/24 15:56:00 [显示全部帖子]

Dim nms As String

Dim tr1 As WinForm.TreeView = e.Form.Controls("TreeView1")
Dim cb As WinForm.ComboBox = e.Form.Controls("ComboBox1")

For Each nd As WinForm.treenode In tr1.nodes
    nms = nms + "|" + nd.name
Next

cb.ComboList = nms


 回到顶部