In this lesson, you will learn about the layout of standard interface and its components used in visual basic programming.
When you open visual basic 6.0 software for the first time, you will see that it opens with the default “Standard.EXE” template. As a beginner, you will work with this interface most of the time. We will leave advanced templates for future tutorials because this is visual basic basics lesson.
The prerequisite to this lesson is that you must install the Visual Basic 6 software on a Windows PC.
The Visual Basic basics – The Design View
The visual basic 6.0 design view is the first interface for a visual basic programmer. You must know this interface in and out to master visual basic basics. You must know how to add controls, manage your project modules and forms, and change the properties of each control that you use in your program.
The following figure shows the standard design view of visual basic 6.0 software. You can click on the image to make it larger.
The interface contains 7 sections and each has a specific functionality.
- Project Container
- Project Explorer
- Properties Window
- Standard Toolbar
- Menu Bar
Every visual basic 6.0 project is made of forms and modules. Each of these forms uses controls like buttons, textboxes, whose properties can be controlled using visual basic interface. Also, you can open or close these components, add, delete, and update forms, modules, controls and databases.
In the following section, you will learn about each component and the role they play in a visual basic 6.0 programming project.
The project container contains the Form object for visual basic 6.0 projects. The Form cannot exceed the project container, if you try to increase the width or the height of a Form, it expands the width or height of the project container also, by adding a scrollbar.
See the example below.
How many project container can you open at the same time?
For each instance of visual basic 6.0, you can open one and only one project container. The visual basic software will ask you to close any open projects before opening a new project.
To know which project you are currently working on, check the title bar of the project container, where it is displayed. The title of the project can be changed from properties windows on the bottom right corner of the visual basic design interface.
A project explorer is a place where you can see all forms and modules associated with your project. You can also add or delete modules form the project explorer. It is located in the top-right corner of the visual basic design view.
In the above figure, you can see the formtest.frm is part of the MyTestProject. The form object contains many control object which is added or deleted from the toolbox.
The toolbox is one of the best features of the visual basic 6.0 programming interface. You can rapidly add any control or delete any control from the form element and change the entire feature. This is was not possible with a high-level language such a C or Java. That’s why Visual Basic 6.0 is so popular among beginners.
The toolbox is located on the left sidebar of the visual basic 6.0 design interface. It is very noticeable because it’s located on the left sidebar.
There are many controls that you can pick from the toolbox. We made a list of those tools that you can use.
- Horizontal ScrollBar (HScrollBar)
- Vertical ScrollBar (VScrollBar)
Each of these control objects have specific properties and methods that it is responsible for. Which control to use on a form is up to the discretion of the visual basic programmer?
Menu Bar and Standard Toolbar
A menu bar is given on the top of the screen along with standard toolbar. The menu bar gives following options to a programmer
- File – You can control open, close or save projects.
- Edit – Perform edits within your project.
- View – Give all kinds of view like project explorer, toolbox, visual component manager, code editor, etc.
- Project – Complete control of adding forms and module including data connections.
- Format – Give options to align Form and Control objects.
- Add–ins – You can include or exclude various visual basic add-ins.
Other menu items are Query, Diagram and so on. The Standard toolbar is nothing but a list of icons to standard components – project explorer, toolbox, properties, etc.
The last and final component of visual basic 6.0 design interface is properties. It is located at the bottom-right corner of the design interface. The properties windows is the most frequently used item for a visual basic programmer.
Each and every element that you add to the form, you must change its properties.
There are global properties and there are local properties to every element. The global property is the name and caption, you must provide for each control object because using the name property, you can decide the behavior of the control object in a visual basic form.
You can change the background color, width or height of an object at run-time.
- Holzner, Steven. 1998. Visual Basic 6 Black Book. The Coriolis Group.
- Vine, Michael. 2001. Visual Basic Programming for absolute beginner. Prima Publishing.