Test
Private Sub LoadNodes()
'Set Treeview Image List for MBTreeViewExplorer
SystemImageList.SetTreeViewImageList(MBTreeView, False)
'New ShellItem to Load Desktop
Dim m_shDesktop As ShellItem = New ShellItem()
Dim tvwRoot As TreeNode = New TreeNode()
tvwRoot.Name = m_shDesktop.Path
tvwRoot.Text = m_shDesktop.DisplayName
tvwRoot.ImageIndex = m_shDesktop.IconIndexNormal
tvwRoot.SelectedImageIndex = m_shDesktop.IconIndexOpen
tvwRoot.Tag = m_shDesktop
Dim arrChildren As ArrayList = m_shDesktop.GetAllDirectories
For Each shChild As ShellItem In arrChildren
Dim tvwChild As TreeNode = New TreeNode()
tvwChild.Name = shChild.Path
tvwChild.Text = shChild.DisplayName
tvwChild.ImageIndex = shChild.IconIndexNormal
tvwChild.SelectedImageIndex = shChild.IconIndexOpen
tvwChild.Tag = shChild
If shChild.IsFolder And shChild.HasSubFolders Then tvwChild.Nodes.Add("PH")
tvwRoot.Nodes.Add(tvwChild)
Next
MBTreeView.Nodes.Clear()
MBTreeView.Nodes.Add(tvwRoot)
tvwRoot.Expand() End Sub
Was this post useful?