Writing Visual Basic Program involves 2 steps:
The Visual Step(Also known as User Interface design) | |
The Coding |
As the name implies, visual really means visual. During the visual step, you will be designing how your program will look like during runtime. This is achieved by using the tools that come with Visual Basic. These tools let you design your programs by using the mouse and the keyboard. This is a great advantage over other programming languages as it allows you to change and experiment with your design until you are satisfied without even running the program! No code writing is neccessary during the visual step. However there are a few simple rules one must follow during User Interface design.
Rule #1: Consistency is key
Don't design three different forms each with a wild background color. Don't have a
"Done" button on one form, an "Exit" button on another, and a
"Quit" button on another.
One of the most powerful ideas behind Windows is the idea of Common User Access. The idea
that every window can be sized, opened, closed, minimized, maximized, etc. with the exact
same method. Menus are in the same place, etc. This idea is powerful because the user does
not have to spend a lot of time learning how to control an application. Once one
application is learned, learning new apps takes less time. The same idea applies within
your application. Give every form roughly the same look and feel, make your menu
structures somewhat similar, make all buttons the same size unless the text requires more
space. Keep these things in mind as you design your forms.
Rule #2: Color should convey information, not overwhelm
While some people consider multi-colored windows nice looking, remember that if your
application is going to define someone's job, if someone is going to sit and use your
application all day long, it can't be hard on the eyes. Light gray is among the easiest
backgrounds to read against. Actually, an off-white background is ideal for reading (such
as is a book page) but using light gray provides for the use of three dimensional effects.
Now, I do not advocate an over-use of 3D effects, but a touch here and there can make a
difference. For example: option buttons and check boxes are much more inviting when they
are 3D. Command buttons are already 3D. Basically, any item that you are going to push to
cause some action is a good candidate for 3D effects. The user sees something move and the
brain equates this with action. Color conveys information. Red means stop, green means go,
yellow means caution. These are socially acceptable uses of color. What does lime green
mean? Did someone get sick?
Rule #3: Try not to overwhelm the user
This is an important rule. Have you ever used a really complex program like Microsoft
Project? Project is a great app, but its overwhelming. Its like sitting down in the
cockpit of an airplane for the first time. Sure, all the controls are there! You can do
ANYTHING YOU WANT! What do you do? Well, I don't know! There needs to be some layering of
information. Menus provide a great way to layer information. The trouble is that many menu
options either fall into more than one category, or none at all. In general, you should
lay out your menus like this:
File, Edit, Options, and Help. Much of what an app does can fall into one of these
categories. Sometimes you need special menus, which is fine, but try to make them fall
under one of the above menus, to remain consistent with many of todays commercial Windows
applications.
There is a point at which too much layering is a problem. The user doesn't want to search four menus deep for a frequently accessed function of the app. If you keep these things in mind, the right way to do things will become more and more apparent to you the more applications you write.
Writing code in Visual Basic is done using a text editor. Programs in Visual Basic are composed of statements written in the Visual Basic programming language. Writing code in Visual Basic is much easier than with any other programming languages. It consist of English like statements which are fairly simple to understand. As you will see later, Visual Basic helps you along as you write your code.