内部函数代码,其余照着改 treeview_cnt
Dim tv As WinForm.TreeView = Forms("訊息主檔").Controls("Tvw_Left")
Dim str As String = Forms("訊息主檔").Controls("Cmb_FilterCol").text
If str > "" Then
tv.BuildTree(Forms("訊息主檔").Controls("ComboBox_TB").Text,str.Replace(",","|"))
For Each nd As WinForm.TreeNode In tv.AllNodes
If IsDate(nd.Name) AndAlso nd.Name.Split(" ").Length > 1 AndAlso nd.Name.Split(" ")(1) = "00:00:00" Then
nd.Text = nd.Text.Split(" ")(0)
End If
If nd.Nodes.Count > 0 Then ' 顯示統計
nd.Text = nd.Text & " " & nd.Nodes.Count & " 筆"
End If
Next
tv.Nodes.Insert("顯示所有資料",0)
Dim ary As String() = str.Split(",")
tv.nodes(0).text = tv.nodes(0).text & " " & DataTables(Forms("訊息主檔").Controls("ComboBox_TB").Text).GetValues(ary(ary.Length-1)).Count & " 筆"
msgbox(tv.nodes(0).text)
End If