|
Global Const Image_Closed = 1
Global Const Image_Opend = 2
Public Sub LoadTreeView(frm As Form, Index As Long)
Dim I As Long
Dim oDIR As DirListBox
Dim oTV As TreeView
Set oDIR = frm.DIR
Set oTV = frm.TV
oDIR.Path = CurDir()
For I = 0 To oDIR.ListCount - 1
If Index = 0 Then
oTV.Nodes.Add , , , DIR(oDIR.List(I), &H16), Image_Closed
Else
oTV.Nodes.Add Index, tvwChild, , DIR(oDIR.List(I), &H16), Image_Closed
End If
Next I
If Index = 0 Then
oTV.Sorted = True
Else
oTV.SelectedItem.Sorted = True
End If
End Sub
| |