M
Maarten
hi all,
i found this code earlier in this group.
now is my question how t handle this code
private sub form1_load(....)
dim fullpath as string = "C:\Documents and Settings\Maarten\My Documents\PLC
prog\Domo\" & Projectname
BuildNodeList(fullpath, ???)
end sub
what do i have te fill in in the questionmarks?
Private Sub BuildNodeList(ByVal currentPath As String, ByVal children As
TreeNodeCollection)
If currentPath.StartsWith(System.IO.Path.DirectorySeparatorChar) Then
ElseIf currentPath.StartsWith(System.IO.Path.AltDirectorySeparatorChar) Then
currentPath = currentPath.Substring(1)
End If
Dim paths() As String
paths = currentPath.Split(System.IO.Path.DirectorySeparatorChar,
System.IO.Path.AltDirectorySeparatorChar)
For Each path As String In paths
Dim child As TreeNode = Nothing
For Each child In children
If child.Text = Path Then
Exit For
End If
Next
If child Is Nothing OrElse child.Text <> Path Then
child = children.Add(Path)
If System.IO.Path.HasExtension(Path) Then
'file
child.ImageIndex = 2
child.SelectedImageIndex = 2
Else
'folder
child.ImageIndex = 1
child.SelectedImageIndex = 1
End If
End If
children = child.Nodes
Next
End Sub
i found this code earlier in this group.
now is my question how t handle this code
private sub form1_load(....)
dim fullpath as string = "C:\Documents and Settings\Maarten\My Documents\PLC
prog\Domo\" & Projectname
BuildNodeList(fullpath, ???)
end sub
what do i have te fill in in the questionmarks?
Private Sub BuildNodeList(ByVal currentPath As String, ByVal children As
TreeNodeCollection)
If currentPath.StartsWith(System.IO.Path.DirectorySeparatorChar) Then
ElseIf currentPath.StartsWith(System.IO.Path.AltDirectorySeparatorChar) Then
currentPath = currentPath.Substring(1)
End If
Dim paths() As String
paths = currentPath.Split(System.IO.Path.DirectorySeparatorChar,
System.IO.Path.AltDirectorySeparatorChar)
For Each path As String In paths
Dim child As TreeNode = Nothing
For Each child In children
If child.Text = Path Then
Exit For
End If
Next
If child Is Nothing OrElse child.Text <> Path Then
child = children.Add(Path)
If System.IO.Path.HasExtension(Path) Then
'file
child.ImageIndex = 2
child.SelectedImageIndex = 2
Else
'folder
child.ImageIndex = 1
child.SelectedImageIndex = 1
End If
End If
children = child.Nodes
Next
End Sub