Dim trv9 As WinForm.TreeView = e.Form.Controls("TreeView9")
Trv9.BuildTree("司机类型表","司机类型","", "编号")
trv9.StopRedraw \'停止绘制目录树
For Each nd9 As WinForm.TreeNode In trv9.AllNodes \'遍历所有节点
Dim sjlx As String = "\'" & nd9.DataRow("司机类型") & "\'"
If nd9.Level = 0 Then \'如果是一级节点
nd9.Text = nd9.text & "(" & dt9.Compute("Sum(数量)","司机类型 =" & sjlx) & "条)"
End If
Next
此主题相关图片如下:qq截图20200815153025.jpg

trv9.Nodes.Insert("显示全部","显示全部(" & dt9.Compute("Sum(数量)") & "条)",0)
trv9.ResumeRedraw \'恢复绘制目录