Foxtable(狐表)用户栏目专家坐堂 → 多级目录树问题


  共有2020人关注过本帖平板打印复制链接

主题:多级目录树问题

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


加好友 发短信
等级:一尾狐 帖子:485 积分:4069 威望:0 精华:0 注册:2015/12/16 8:22:00
多级目录树问题  发帖心情 Post By:2016/6/6 12:55:00 [只看该作者]

Dim tr As WinForm.TreeView
Dim
 nd As WinForm.TreeNode
tr = e.Form.Controls(
"TreeView1")
nd = tr.SelectedNode

If
 nd IsNot Nothing Then
    
If nd.Level = 2 Then
        MessageBox.Show(
"最多允许三层节点!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    Else
        
Dim dr As DataRow = DataTables("表A").AddNew
        If
 nd.Level = 0 
Then
            dr(
"大类") = nd.Text
            dr(
"二类") = "新节点"
        
ElseIf nd.Level = 1
            dr(
"大类") = nd.ParentNode.Text
            dr(
"二类") = nd.text
            dr(
"三类") = "新节点"
        
End If
        nd = nd.Nodes.Add(
"新节点")
        tr.SelectedNode = nd
        tr.
Select()
        tr.BeginEdit()

    End
 
If
End
 If


发现若修改为5层的话,发现第5不能输入只能修改,请问若有5层的话代码应该如何修改?

 回到顶部