File system controls, Visual Basic Programming

Assignment Help:

FILE SYSTEM CONTROLS

There are 3 file system controls as shown in figure. The drive list box, directory list box & the file list box. The drive list box control is used to exhibit the disk drives on the system like A drive, C drive, D drive etc. The down arrow in the control helps you to visualize all the accessible drives in the system. The directory list box is used to exhibit the directories accessible in the selected drive. The file list box exhibits all the files in the selected directory. To test the file system controls pursue the steps given below:

1. Build a project.

2. Drag the drive list box, directory list box & the file list box from the tool box and drop on the form.

3. Place a text box on the form.

4. Handle the change event for the drive list box object. The object would be Drive1 by the default.

5. The Handle change event for the directory list box object. The object would be Dir1 by the default.

6. The Handle click the event for the file list box object. The object would be from File1 by the default.

7. The CurDir$ is a Visual Basic keyword. It is used to represent the path of the present directory, drive &file.

8. Handle form the load event. Now Code the form_load handler as shown below:

Private Sub Form_Load()

Drive1.Drive = CurDir$

Dir1.Path = CurDir$

File1.Path = CurDir$

File1.Pattern = "*.*"

End Sub

The keyword CurDir$ stores the selected drive's path in the Drive1 object. The data member drive holds the selected drive's path. The keyword CurDir$ stores the selected drive's path in the Drive1 object in the above code snippet. The data member Drive holds the selected drive's path. The keyword CurDir$ stores the path of the selected directory in the Dir1 object. The data member Path holds the selected directory's path. The keyword CurDir$ stores the selected file's path name in the File1 object. The data member Path holds the selected file's path name.

9. The Handle change the event for the Drive1 object. Now Code the handler as shown below.

Private Sub Drive1_Change()

Dir1.Path = Drive1.Drive

End Sub

Dir1.Path sets the path of the directory from the present drive.

10. Handle the change event for the Dir1 object. Code the handler as shown below.

Private Sub Dir1_Change()

File1.Path = Dir1.Path

End Sub

File1.Path sets the path of the file from the present directory.

11. The Handle click the event for the File1 object. Now Code the handler as revealed below.

Private Sub File1_Click()

Text1.Text = File1.FileName

End Sub

File1.FileName returns the selected file's name and that is stored in the text box

Text1.

918_file system control.png

Figure: File System Control


Related Discussions:- File system controls

Program to draw a rectangle shape , Create a project that draw a rectangle ...

Create a project that draw a rectangle shape which may be either (*) or (+) according to the selected radio button. The number of rows in the shape will be taken from the 1 st

Need help on macros in visual basic, I have an excel list with a lot's of s...

I have an excel list with a lot's of serial numbers that have been entered by hand from PDFs online (1-5 serial numbers per PDF). Many of the values are duplicates, wrong, or conta

It, flow chart symbols

flow chart symbols

Lotto, You are asked to create the LOTO game customized according to the fo...

You are asked to create the LOTO game customized according to the following constraints: 1. Create a grid containing 20 numbers (20 buttons: button1, button2, …button20) 2. When t

Accelerators - intrinsic control, Accelerators: The Accelerators are s...

Accelerators: The Accelerators are short cut keys. The Accelerators are formed by placing an ampersand before any of the characters of the Caption. As a product the letter fol

Visual basic 2012, I am a beginner in Visual basic 2012 and making a data m...

I am a beginner in Visual basic 2012 and making a data management programme with visual basic 2012 as front end and MySql as back end. I want to filter data grid view table with Li

Select case - control statement, Select Case: The Select Case is used ...

Select Case: The Select Case is used for handling the multiple paths. The Select Case computes the expression and depending on the value of the equivalent Case statement execu

Project to display a database - data control, A Project to Display a Databa...

A Project to Display a Database: 1. Suppose that there are 5 fields describing a customer. Id, address, name, city & state. 2. Put 5 text boxes on the form to exhibit the r

What is the method of creating a new project in vb.sss, Visual Basic 1....

Visual Basic 1. What is the method of creating a new project in VB.SSS 2. Illustrate Code Editor Window and Solution Explorer. 3. Write a VB program to sort and display a

Repeating a statement until a condition becomes true, You can employ until ...

You can employ until keyword in two ways to verify a condition in a Do...Loop statement. You can verify the condition before you enter the loop (as illustrated in the following Chk

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd