Site hosted by Angelfire.com: Build your free website today!

EXTRA INFO

Getting Started with VB6

GUI

Removing the form

Getting to the Next Lesson

 

 

 

 

WELL DONE !!

lesson 1 (Part 2) - Manipulating the workspace

AIM - To Understand How to Use the VB6 Program

 

Close any existing work and open a new Visual Basic (VB) Programming Environment. Start >> Programs>> Visual Basic 6. Open a new Standard EXE file.

You should now understand the names of the areas of the workspace. We will explain more fully what each area does. Firstly the small screen that appears when you open the program is the New Project window it allows you to choose many different types of files. For the remainder of THIS course you should only choose the Standard EXE file unless you are a more experienced user.

StartScreen

Once the Project is selected you should see the window below. Here the form layout window has been removed, same as last lesson. If your form window is still visible close it by clicking on the cross in the top right corner. If your not sure what the form layout window looks like go back to last lesson. Your workspace should look like below.

 

The form is shown as number 2. This will become the background of your 'running' program. It can be resized, coloured and objects and shapes added to it. The code never appears on the form. You will use the form to create your own Graphical User Interfaces or GUI's for your own programs later at level 2. We are going to remove the form and teach you to code using a module. It is important that you learn how to code before we 'move on' to designing a GUI.

Locate the Project Window shown as number 3 above. Right click on Form1 and choose 'Remove Form1' from the drop down menu.

No Form

Your workspace will look as above. We will now remove the remaining windows so you know how to find them again if you lose them! Close the Toolbox, Project and Properties window by clicking on the cross on the top right. They are numbers 3, 4 and 6 on the numbered workspace picture.

The only things that will be visible are the Standard and Menu Toolbars. The other items have not 'disappeared' they are just no longer visible and important concept for later! Our workspace will now look like this

Empty

There are just two visible toolbars, Standard and Menu. You will need to use both.

Toolbars

To put the windows back that we removed we will use the shortcut icons on the standard toolbar.

Icons

The Project window is restored by clicking the first icon.

The Properties window by the second. This is a standard icon the Microsoft use for 'properties' in many applications and represents an index card containing information about something.

The third 'Form' icon replaces the form layout window so if you click this just close it it by clicking on the cross (top right of the window). Note this does not ADD a form just makes the layout window visible.

Click the fourth icon and the Object Browser appears, we wont be using this so just close it by clicking on the cross (top right of the window).

The filth icon replaces the toolbox, we won't be using this either so you can leave it open or close it.

Finally the last icon is for working with database we wont be using this so close the window if you opened it.

Now your workspace should be back to normal view but without a form. Lets add a module so we know how to.

Steps:

  1. Check you have removed the form (see above)
  2. On the Menu toolbar add Project >>Add Module, then click Open. You should have the widow below if not close down your application (DO NOT SAVE) and re-open VB. Go to step 1

    Module

  3. There are two drop down menus on the module window (General) and (Declarations) note that there are no options here at present.
  4. This is the window that allows us to write code without using a GUI. Input and output is manipulated by the use of Inputbox and Msgbox (A small window that the user can type information into and a window that can display information to the user).
  5. OK lets remove the module by right clicking on the Module in the Project Window and choosing remove Module1. When prompted to save choose No.
  6. Now re-add the form by right clicking on Project1 in the Project Window choose Add and then Form. You will have a choice of forms, see below
  7. For this course always chooses the first form 'Form'.

FormChoice

Well done! You are now ready to re-do these steps using the Menu Toolbar and code your first small program.

Next