Windows Develop Bookmark and Share   
 index > Windows Forms Designer > How to show directory structure on Windows Form in VB.Net 2005?
 

How to show directory structure on Windows Form in VB.Net 2005?

I want to show complete directory structure of my hard on the windows forms.

Is there any inbuilt control for this in VB.Netor I have to create Tree View for this?

Please note that I want to show iton form and not in dialog box otherwise I know how to useOpenFIleDialog, FolderBrowserDialog controls.

Can weshow FolderBrowserDialog in some control on form.

Harsh1  Friday, September 28, 2007 8:46 AM

Hi Harsh,

Visual Basic 2005 provides DirListBox, DriveListBox, and FileListBox controls as part of the Microsoft Visual Basic Compatibility Runtime library. You can add a these controls to Visual Studio toolbox. Take the following steps.

1. On the View menu, choose Toolbox.

2. Right-click Toolbox and then click Choose Items�

3. In the Choose Toolbox Items dialog box choose the �NET Framework Components�tab , and check the DirListBox, DriveListBox, and FileListBox components, then click OK.

Now these controls will be added to the toolbox, you can drag and drop them onto the Windows Form. For more information, check the following article on MSDN.

· How to: Add Visual Basic 6.0 File System Controls to Your Application

Hope this helps.
Best regards.
Rong-Chun Zhang

Rong-Chun Zhang  Thursday, October 04, 2007 2:50 AM

In visual basic 6.0 we were having controls like DriveListBox, DirectoryListBox, FileListBox.

But these controls are missing in VB.Net 2005.

So how could I show Directory structure on windows forms.

Harsh1  Monday, October 01, 2007 8:43 AM

How canI Use DriveListBox, DirectoryListBox, FileListBox controls of VB 6.0 in Vb.Net 2005?

Harsh1  Wednesday, October 03, 2007 8:33 AM

Hi Harsh,

Visual Basic 2005 provides DirListBox, DriveListBox, and FileListBox controls as part of the Microsoft Visual Basic Compatibility Runtime library. You can add a these controls to Visual Studio toolbox. Take the following steps.

1. On the View menu, choose Toolbox.

2. Right-click Toolbox and then click Choose Items�

3. In the Choose Toolbox Items dialog box choose the �NET Framework Components�tab , and check the DirListBox, DriveListBox, and FileListBox components, then click OK.

Now these controls will be added to the toolbox, you can drag and drop them onto the Windows Form. For more information, check the following article on MSDN.

· How to: Add Visual Basic 6.0 File System Controls to Your Application

Hope this helps.
Best regards.
Rong-Chun Zhang

Rong-Chun Zhang  Thursday, October 04, 2007 2:50 AM

Thanks, it works fine.

But I wonder why such useful controls are not in .net 2005

Harsh1  Monday, October 08, 2007 8:56 AM

You can use google to search for other answers

Custom Search

More Threads

• Property returning an Object (ExpandableObjectConverter, Default Values...)
• Tabs Per Row
• How to add a custom property grid to a user control
• Abstract Base Class
• 2005 RTM: A circular control reference has been made. A control cannot be owned by or parented to itself.
• Custom ControlDesigner for a user control hosted in Internet Explorer
• Changing the application icon
• How To Select A TreeNode With Code
• Selecting control within my user control in the Designer
• RichTextBox not updating :-(