Creating Your First Project
Open a new project
-
Start Visual Studio.
-
Pull down the File menu, choose new project.
-
Select the Windows Application icon in the New
Project window.
-
Type in a name for the project at the bottom of
the same window.
-
Click OK in the right corner of the same window.

The Visual Basic 2005 IDE

Create the user interface for a new program
Size the form
The
size in pixels will show in the lower right corner.
Add controls to the form
-
If the
ToolBox is not visible on the left, click the toolbars tab in the
leftmost margin.
-
Click
the tool to select it, then click and drag on the form to place and
size the control.
Or
Move the control
Lines
will appear on the form as you move controls showing where the
control will line up with other existing controls. This can help
you make a well lined up form.
Resize the control
You can
drag up/down, left right and on a diagonal.
Set object properties
Objects drop down list
The properties window has a drop down list at the
top where you can select the object to make the property selections.
The object displayed by default will be the selected object.

Set the properties for each object in our user interface
-
Click the control to select it, then the
properties window will show the properties for that control.
-
Click the property you want to work with in the
right (settings) column.
-
You may have a drop down list box with
selections to choose from, or a dialog window may open with many
choices. You may also be able to type in the setting.


Make settings to a group of objects simultaneously
-
Click the first object, then hold down shift and
click the other objects.
-
Make object property settings.
Note: There are some properties which cannot be
set this way.
Write the program code
-
Double click the object to access the code
editor.
-
Type in the code, press the down arrow key to
“enter” it.
-
Click the form in the Solution Explorer window
to toggle back to the form.
-
As you type, possible autofills will appear.
Press the space bar to take the highlighted autofill suggestion.
Move through autofill choices with the up and down arrow keys.
-
A single quote mark is used to start a comment.
-
The underscore (uppercase dash) is used to extend a
statement to the next line.
Save and the program
This saves the project, the form and any code
modules. You named the project when you started with the New Project
command.
Run the program


Build an executable file
Your project's name will appear in the sub menu.
When you do this, an executable version will be created and stored in
the bin subdirectory of the project directory. The executable
version will run outside of the Visual Basic IDE. It can also
run on any computer, even if Visual Basic is not installed on it.
It is an independent software application.
Run the executable version of the program
-
Use the Windows start button, then run
-
Click the browse button and find the project
folder, then the bin folder with it.
-
You will find the executable file there.
-
Select the file and then click OK to run the
program.
|