Getting Started
Now that you have bought your copy of Visual Basic, whatever its
edition, we can take our first look at where you will be spending the next 10
years of your life! (on your PC anyway) I am going to assume that you have successfully
installed your copy - this does not usually pose any problems.
Double-click on the Visual Basic icon, and after a little while
you will be greeted with the New Project screen. From here, you can then create
a new VB project, open an existing one, or re-load one you have recently opened.
For the sake of this tutorial, select 'Standard EXE' and click Open. And there
you go, your new VB application - or at least an application that displays an
empty form. In VB, any dialog that a user is shown is known as a form;
when you click save, and a save dialog appears, that is a form. When you type
the text in a Word document, or open the options dialog, or anything else, that
is a form too!
Before we start doing anything, we need to do something that anyone
(with any sense!) who regularly uses Microsoft applications does - save your
work! To do this, click the Save icon on the toolbar. You will then be prompted
for two filenames. The first is a location for the Form. All good programmers
use a 'naming convention'. This basically means that the programmer will
use a standard format for all files, or controls, or anything else. Therefore,
before naming the file, we want to stick to this convention. These can vary,
but normally they follow these two rules:
- Use uppercase letters for the start of each word - spaces are
not allowed for names when programming! Some programmers also use a _ (underscore).
For example, if I wanted to name something 'my first form', it would be named
My_First_Form.
- Add three letters before the name, so that you can instantly recognise what
it is. When programming, you end up using an awful lot of names for different
things. Naturally, because the things we are naming can be different sorts of
things, we need to be able to tell what sort they are, without having to trawl
through our code to find out. How do we do this? Using three meaningful letters
(or sometimes one, if a programmer wants to have a really hard time coming up
with different letters).
In this case we are saving a form, so three letters that are often
used are frm. Consequently, as this is an example form, we put the letters 'frm'
and 'Example' together, getting 'frmExample'. Enter this in the first Save As
dialog, and click Save. The next dialog that appears is for saving the Project
file. For projects, we normally use 'prj' as our three letters, so save this
one as 'prjMy_First_App'. (In case you are wondering what App is, it is an abbreviation
of Application).