Display Folders and Subfolders in a Treeview

Category:
Forms and Controls
Type:
Snippets
Difficulty:
Intermediate
Author:
Raja Pandian

Version Compatibility: Visual Basic 6

More information:
This is a very simple code that you can load a directory easily in a tree view control. And also you can add the folders and subfolders in a drive too. The sub works by calling itself recursively and it uses the file system object.

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: