Foxtable(狐表)用户栏目专家坐堂 → 奇怪,为什么不能成生treeview


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

主题:奇怪,为什么不能成生treeview

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


加好友 发短信 一级勋章
等级:MVP荣誉狐 帖子:5154 积分:31434 威望:0 精华:8 注册:2008/9/8 12:27:00
  发帖心情 Post By:2010/10/21 21:26:00 [显示全部帖子]


Dim tr As WinForm.TreeView = Forms("窗口").Controls("TreeView1")
Dim nd0,nd1,nd2 As WinForm.TreeNode
Dim fs As Integer
tr.Nodes.Clear   '清空原来的节点::::::::::
For Each dr As DataRow In DataTables("单位树").Select("","标题id")
    If dr("标题id") <> "" Then
        fs = dr("节点")
        Select Case fs
            Case 0
                nd0 = tr.Nodes.Add(Rand.NextString(10),dr("标题"))
            Case 1
                nd1 = nd0.Nodes.Add(Rand.NextString(10),dr("标题"))
            Case 2
                nd2 = nd1.Nodes.Add(Rand.NextString(10),dr("标题"))
        End Select
    End If
Next

 回到顶部