Dim dic As new Dictionary(Of String, String)
dic.Add("2015年6月", 1)
dic.Add("2015年7月", 3)
dic.Add("2016年6月", 1)
Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
For Each key As String In dic.Keys
Dim ary() As String = key.Split("年")
Dim nd As WinForm.TreeNode
If trv.Nodes.Contains(ary(0)) = False Then
nd = trv.Nodes.Add(ary(0))
Else
nd = trv.nodes(ary(0))
End If
ary(1) = ary(1).Replace("月", "")
If nd.Nodes.Contains(ary(1)) = False Then
nd = nd.nodes.Add(ary(1))
Else
nd = nd.Nodes(ary(1))
End If
If nd.Nodes.Contains(dic(key)) = False Then
nd = nd.nodes.Add(dic(key))
Else
nd = nd.Nodes(dic(key))
End If
Next