How to: Add Visual Basic 6.0 File System Controls to Your Application
We recommend that you use theand components to provide access to the file system; however, if you find it necessary to create your own file dialog boxes, Visual Basic 2005 provides DirListBox, DriveListBox, and FileListBox controls as part of the Microsoft Visual Basic Compatibility Runtime library.
You can add a DirListBox, DriveListBox, or FileListBox to a Windows Application project using the following procedures.
The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see.
Adding Controls to Your Project
To add a reference to the Compatibility library
On the Project menu, choose Add Reference.
In the Add Reference dialog box, click the .NET tab. Under the Component Name list, choose Microsoft.VisualBasic.Compatibility, and then click OK.
A reference will be added to your project.
To add the controls to the Toolbox
On the View menu, choose Toolbox.
Expand the All Windows Forms section. Right-click its title bar and then click Choose Items.
In the Choose Toolbox Items dialog box, check the DirListBox, DriveListBox, and FileListBox components, and then click OK.
The controls will be added to the Toolbox; they can be used like any other Windows Forms control.
Once added, the controls will remain in the Toolbox until you explicitly remove them.