Hi all,
I've made an treeview application with checkboxes beside each directory.
I have a few drives here (including mapped network drivres), linked to servers etc, so when loading the form I'm recursively building the treeview.
The problem is, it takes quite a while to build just the C:, then the mapped network drivers etc, surely there is a quicker way to do this?
Otherwise everytime a user uses my program to check the boxes I'll have to display a message "Please wait while the directories are being built" etc, it won't look very professional.
Here is a bit of the code on how I build the treeview.
So, if there a quicker way? I'm aiming to make some backup software, so it would be nice for the user to be able to select the directories they wish to backup, without having to wait each time for the directories to be built!
Appreciate any help.
Thanks,
Ricky
I've made an treeview application with checkboxes beside each directory.
I have a few drives here (including mapped network drivres), linked to servers etc, so when loading the form I'm recursively building the treeview.
The problem is, it takes quite a while to build just the C:, then the mapped network drivers etc, surely there is a quicker way to do this?
Otherwise everytime a user uses my program to check the boxes I'll have to display a message "Please wait while the directories are being built" etc, it won't look very professional.
Here is a bit of the code on how I build the treeview.
VB.NET:
On Error Resume Next
Dim node As TreeNode
'Loop through each folder in the directory
For Each di As IO.DirectoryInfo In _
New IO.DirectoryInfo(dir).GetDirectories()
'Add a new node
node = New TreeNode(di.Name)
rootNode.Nodes.Add(node)
'If there are subfolders, then loop through them
If di.GetDirectories().Length > 0 Then
AddDirectory(node, di.FullName)
End If
Next
Appreciate any help.
Thanks,
Ricky