Dim tr As WinForm.TreeView = e.Form.Controls("TreeView1") tr.GenerateTree(DataTables("表A"),"代码","名称",".") Dim btr = tr.basecontrol tr.nodes.add("根目录", "根目录") Dim pnd = btr.nodes("根目录") For i As Integer = btr.nodes.count-2 To 0 Step -1 Dim nd = btr.nodes(i) btr.nodes.remove(nd) pnd.nodes.Insert(i, nd) Next