INVESTIGATORY PROJECT
REPORT
In
COMPUTER SCIENCE
(‘Visual Basic’ Programming
Language)
On
Use of file system control
SUBMITTED TO –
MR. RAJKUMAR
(COMPUTER FACULTY)
Submitted by –
Name : Riya Sharma
Father’s Name : Mr. Sushil Sharma
Class-Section : XII-D
Roll No. :
Riya Sharma Class-XII-D
TABLE OF CONTENTS
Introduction
Certificate
Acknowledgement
Aim
Introduction to the topic
Program
Coding
Output
Conclusion
Riya Sharma Class-XII-D
INTRODUCTION TO ‘Visual Basic’
Introduction
Visual Basic Introduction
Visual Basic is a popular programming language among beginners. It was
developed by Microsoft in May, 1991. It is based on the BASIC language and
provides a variety of tools to create user-friendly application with Graphical User
Interface (GUI). That is why, it is called Visual Basic. VB creates Event Driven
applications, which encourage higher user interaction through icons, menus,
pointers, buttons, dialog boxes etc.
Event Driven Programming
While using an application, a user performs actions such as pressing a key, clicking
a mouse, selecting a check box or selecting a list item etc. Such actions are known
as events.
In Event Driven programs, the statements are not executed in the sequence in which
they are written. They only get executed when a corresponding event occurs.
Modes of VB Program
A Visual Basic program has three modes:
1. Design Mode – As the name suggests, this is the state when we create
objects and write objects and write logical statements for VB applications. In
this mode, the programmer plays a very important role.
2. Run Mode – This is mode in which the statements written by a programmer
are executed by the end-user and the application performs the tasks for which
it has been designed.
3. Break Mode – When an application generates errors or does not give the
desires results, we halt its execution for removing errors. Such a mode is
called the break mode.
Riya Sharma Class-XII-D
Components of Visual Basic IDE
Title Bar – The title bar is present at the top of the window and displays the name
of the currently opened project.
Menu Bar – Menu bar contains many menu items and sub menu. These items
give access to various options which help in developing the application.
Tool Bar – Tool bar contains small icons that give access to frequently used menu
items. These icons act as shortcuts to the options available in the menu bar.
Form Window
Form is an interface using which a user interacts with the application. A form
contains many control elements such as labels, text boxes and command buttons etc.
Using these controls, a user can enter data and give instruction to the application.
The form window provides us with a blank form where we can place various
controls, as per our requirements.
Properties Window
Properties are attributes that define the appearance and behavior of objects (Forms
and other controls). Forms have many properties such as name, font, color, border
style, padding, size, text etc. Properties window is used to set the properties of form
and other controls placed on them.
Solution Explorer
This window displays a list of forms and other objects that constitute the
application. This list is organized in the form of a branching structure like windows
Explorer. To open any object, we can double-click on its icon in the solution
explorer window.
Tool Box
As the name suggests, the Toolbox contains various controls as command button,
textbox, and label etc.
These controls can be added to the forms by simple dragging and placing them at
the desired location.
Riya Sharma Class-XII-D
Code window
Code window is used to write codes for any objects. To write codes, double-click
the object on the Form. This action opens the code window where we can write the
required visual basic statements.
Developing a VB Application
To develop an application using VB, follow the given steps:
1. Create a Form and add controls in it.
2. Set properties of the controls.
3. Write codes for various events of added controls and run the application.
Adding Controls to the form
To add a new control to the form, follow the given steps –
1. Click the desired control in the tool box and bring the pointer on the Form.
2. Move the pointer to the desired location and drag it to draw the selected
control.
3. The control will be placed on the form.
4. We can change the size, shape and location of the control as per our
requirement.
Setting properties of the controls
1. Select control in the Form.
2. Click on the desired property in the properties window.
3. Set the property and observe the change in the Form.
Riya Sharma Class-XII-D
Commonly used Controls
1. Label: A label is used to display some text, or display message on the form.
Common Properties of Labels –
a. Name – The name property identifies a label while writing the program.
b. Font – This property sets the font, font size, font style etc for the label.
c. Fore Color – This property changes the foreground color of the label used for
displaying text.
d. Caption – This property contains the text which is displayed on the label.
e. Visible – This property determines whether the control is visible or hidden.
Riya Sharma Class-XII-D
CERTIFICATE
This is to certify that “Riya Sharma” has completed this project report under
my guidance on application “Use of file system control” in ‘Visual Basic’
Programming Language during the year 2019-2020. They are submitting this
project report in partial fulfillment of the requirements for the award of
qualifying examination.
Mr. Rajkumar
(Computer Teacher)
Riya Sharma Class-XII-D
ACKNOWLEDGEMENT
I, Riya Sharma wish to express our gratitude with a great pleasure towards
respected principal Mrs. Rajni Ohri for providing all the facilities. I am equally
indebted Mr. Rajkumar for the constant encouragement and able to guidance
the rendered to me for completing this study.
I am also highly obliged to my parents who helped me financially to undertake
and complete this work last but not the least I am immensely grateful to
colleagues for their coordination in completing this work.
Submitted By:-
Name : Riya Sharma
Father’s Name : Mr. Sushil Sharma
Class-Section : XII-D
Roll No. :
Riya Sharma Class-XII-D
AIM
“Use of file system control” using ‘Visual Basic’ Programming
Language.
Riya Sharma Class-XII-D
Introduction to the Topic
File System Control: DriveListBox, DirListBox, and FileListBox
The three file system controls are used to access the computer’s file system. Using
these controls, the user can traverse the host computer’s file system; locate any
folders or files on any hard disk, even on network drives. The file controls are
independent of one another and each can exist on its oun, but they are rarely used
separately.
Drive List Box – Displays the names of the drives within and connected
to the PC. The basic property of this control is the drive property, which sets
the drive to be initially selected in the control or returns to the user’s
selection.
Dir List Box –Displays the folders of the current drive. The basic property of
this control is the path property, which is the name of the folder whose
subfolders are displayed in the control.
File List Box – Displays the files of the current folder. The Basic Property of
this control is also called path, and it’s the path name of the folder whose
files are displayed.
Riya Sharma Class-XII-D
DESIGN TIME
Make an application to show the use of the file system control in VB
Riya Sharma Class-XII-D
CODING TIME
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
Private Sub Form_Load()
Drive1.Drive = "C:\"
Dir1.Path = "C:\"
File1.Path = Dir1.Path
End Sub
Private Sub Text1_Change()
If Right(Text1.Text, 1) = "\" Then
Drive1.Drive = Left(Text1.Text, 3)
Dir1.Path = Text1.Text
End If
End Sub
Riya Sharma Class-XII-D
RUN TIME
Riya Sharma Class-XII-D
CONCLUSION
In this project we want to show the use of the file system
control using drive list box, dir list box and file list box.
These applications show the files of a particular drive and
folder.
Riya Sharma Class-XII-D