Visual Basic 2005


Add to MY Favorites...

Back to Vicky's Home Page Teaching Home Page Visual Basic 2005 Html For Kids

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.

  • A blank form will appear in the IDE.

  • The form will be selected in the Solution Explorer and Properties windows.

     

The Visual Basic 2005 IDE

 

Create the user interface for a new program

  • Access the form by double clicking Form1.vb in the Solution Explorer window.

Size the form

  • Click and drag borders.

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

  • Double click the control to get a standard sized version of the control in the upper left corner of the form.

Move the control

  • Point over the control until a 4 headed arrow appears.

  • Click and drag 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

  • Click and drag a corner.

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

  • Pull down the File menu, choose Save all.

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

  • Pull down the Build menu, then choose build projectname

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.

 


 
Another page developed by
vicky@vickywoodard.com
Copyright © 2006 Vicky K. Woodard
All rights reserved
Last updated: 8/17/2006