Tutorial Reference # 19

Title: Introduction to Visual Basic
Language: Visual Basic
Description: Introduction to the development enviroment in Visual Basic.
Author: circuit
Added: March 10, 2007, 12:29 am
Rating: Not rated
You need to be logged in to rate a tutorial

     


Visual Basic


Before we start programming, let's start with a definition of Visual Basic. Visual Basic is an object-orientated programming language that is designed for developing applications and games for Microsoft. It is a simple programming language to learn and you won't need any knowledge of other programming languages to use it. I would not recommend learning visual basic as your first programming language, but I would say that it is very easy to learn and it is actually a very powerful language, so get ready to write your first program in VB.


Ok, let's get acquainted with the development environment of Visual Basic. You need to know where each function is and what its purpose is.







This is an image of Visual Basic's development environment in all its glory. I will be discussing three of its components;

- Tool Box
- Default Form
- Project explorer
- Properties Menu


Project Explorer:

The project explorer displays forms, modules and other separators that visual basic supports. If you want to select a form you have made, you must select
it in this window.






Tool Box:







This is the Tool Box. I wont give you descriptions of the different functions just yet because we will be using them in the following tutorials and I will explain them when you will use them!


Default Form:

This is where it all happens. When you open your Visual Basic project you are presented with your default form, where you add functions to it and assign events to. You must double click the form to insert your code, and inside the form box there are two drop down menu's, named Object and Procedure. The object menu will be explained later on, but the procedure is basically the method in witch you want your event to be carried out, here is an image of the menu,






Properties Box:






This is the properties box where you can customize your form, here are the button properties,

Property Description
Name The name of the object so you can call it at runtime
BackColor This specifies the command button\\\'s background color. Click the BackColor\\\'s palette down arrow to see a list of common Windows control colours, you must change this to the style property from 0 - standard to 1 - graphical
Cancel Determines whether the command button gets a Click event if the user presses escape
Caption Holds the text that appears on the command button.
Default Determines if the command button responds to an enter keypress even if another control has the focus
Enable Determines whether the command button is active. Often, you\\\'ll change the enable property at runtime with code to prevent the user pressing the button
Font Produces a Font dialog box in which you can set the caption\\\'s font name , style and size.
Height Positions the height of the object - can be used for down
Left Positions the left control - can be used for right
MousePointer If selected to an icon can change the picture of the mouse pointer over that object
Picture Hold\\\'s the name of an icon graphic image so that it appears as a picture instead of a Button for this option to work the graphical tag must be set to 1
Style This determins if the Command Button appears as a standard windows dialog box or a graphical image
Tab index Specifies the order of the command button in tab order
Tab Stop Whether the object can be tabbed to ( this can be used in labels which have no other function )
Tool Tip Text If the mouse is held over the object a brief description can be displayed (for example hold your mouse over one of the above pictures to see this happening
Visible If you want the user to see the button/label select true other wise just press false
Width Show the width of the object


Finally, after you have written your code in the Form, and wish to preview it, there is a control box under the Tool box with three icons,





The play button is to execute your program, the pause button is to,well, pause the program, and the stop button is to terminate the program and return to the programming page. Move on to the next section to start programming.

     

Copyright 2007 © CircuitCoders.net - All Rights Reserved.