代码
Dim tv As WinForm.TreeViewtv =e.Form.Controls("TreeView1")tv.BuildTree("表A", "省份|县市")For Each nd As WinForm.TreeNode In tv.AllNodes If nd.Level = 1 Then If nd.DataRow("备注") = "ok" Then nd.BackColor = Color.Red End If End IfNext