Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
trv.BuildTree("课程表","学校名称|班级|星期|节次" ,"", "班级,星期,节次")
trv.StopRedraw '停止绘制目录树
For Each nd As WinForm.TreeNode In trv.AllNodes '遍历所有节点
If nd.Level = 3 Then '如果是二级节点
nd.Text = nd.text & "," & nd.DataRow("科目") & "," & nd.DataRow("任课教师")
End If
If nd.level = 2 Then
nd.Text = "星期" & nd.DataRow("星期")
End If
If nd.level = 1 Then
nd.text = nd.DataRow("班级").Substring(3,2) & "级" & nd.DataRow("班级").substring(5,2) & "班" & nd.DataRow("班级").substring(7,1) & "期"
End If
Next
trv.ResumeRedraw
组合框textchanged 重新加载了, 另外目录树按了节次排序,但节次是无序的呢,请帮忙指点,谢谢!