DriveListBox,DirListBox and FileListBox in Visual Basic 6.0


Three of the controls on the ToolBox let you access the computer’s file system. They are DriveListBox, DirListBox and FileListBox controls .

The Drive ListBox  is used to display a list of drives available in your computer.When you  place this control into the form and run the program,you will be able to select different drive from your computer.

The DirListBox is Directory ListBox is used to display the list of directories or folder in a selected drive.When you place this control into the form and run the program,you will be able to select different directories from a selected drive in your computer.

The FileListBox is used to display the list of files in a selected directory or folder.When you place this control into the fo form and run the program,you will be able to a list of files in a selected directory.

1. Start Visual Basic and pick “Standard Exe” from the list of new projects.

2. A form1 container is open.

3. Add DriveListBox,DirListBox and FileListBox from the toolbox.

 

 

 

 

 

 

 

4. Double click on Drive control.Code window is open. Write code here.

5. After you select Dir1 object from object drop down list.Write code here.

 

 

 

 

 

 

 

 

 

 

6.Press <f5> key to  run the program and select the option to see what happens.

 

 

Comments are closed.