Home » VB 6.0 Tutorial » VB 6 basics

VB 6 basics

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.

Visual Basic 6 Design Interface

The interface contains 7 sections and each has a specific functionality.

  1. Project Container
  2. Form
  3. Project Explorer
  4. Properties Window
  5. Toolbox
  6. Standard Toolbar
  7. 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.

Project Container

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.

Visual Basic basics – Project Container

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.

Project Title

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.

Project Explorer

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.

Visual Basics basics – Project Explorer

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.

Tool Box

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.

Visual Basics basics – Tool Box

There are many controls that you can pick from the toolbox. We made a list of those tools that you can use.

  1. Pointer
  2. PictureBox
  3. Label
  4. TextBox
  5. Frame
  6. CommandButton
  7. CheckBox
  8. OptionButton
  9. ComboBox
  10. ListBox
  11. Horizontal ScrollBar (HScrollBar)
  12. Vertical ScrollBar (VScrollBar)
  13. Timer
  14. DriveListBox
  15. DirListBox
  16. FileListBox

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

  1. File – You can control open, close or save projects.
  2. Edit – Perform edits within your project.
  3. View – Give all kinds of view like project explorer, toolbox, visual component manager, code editor, etc.
  4. Project – Complete control of adding forms and module including data connections.
  5. Format – Give options to align Form and Control objects.
  6. Addins – 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.

Properties

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.

Visual Basics basics – Properties Window

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.

For example

You can change the background color, width or height of an object at run-time.

References

  • Holzner, Steven. 1998. Visual Basic 6 Black Book. The Coriolis Group.
  • Vine, Michael. 2001. Visual Basic Programming for absolute beginner. Prima Publishing.