subscribe: Posts | Comments

The development environment

0 comments
HTML clipboard

I. The development environment
The integrated development environment Visual Basic (FDI: Integred Development Environment) can be customized, as regards its presentation and modus operandi.

However, it is preferable before starting your first project to make some adjustments:
1) – In the menu bar, click on the label "Tools", then "Options" in the "Editions" you check all the boxes except "display module complete" and the width of the tab you enter the value "2".

2) – Select the "General" tab, you change the values of units of the grid to "30"
3) – Select the tab "Anchorage" and disable all coches checkboxes.

When you're more comfortable with your work environment, you can adjust the options to customize to your taste.
We will see later other interesting settings.

II. Your first project VISUAL BASIC
II.1. Creation of the interface
Most applications made with Visual Basic include at least one leaf.
The leaves (Form in English) are the basic elements of the user interface.
They form containers (containers) receiving checks, as buttons, text areas, check boxes, etc. … which can be adapted to suit your creative abilities.
When you start Visual Basic, the editor window sheet shows a blank sheet named Form1 (Name that you find in the title bar).

II.2. Defining the size of the leaf
There are several ways to create our paper, the easiest is to achieve an image and incorporate it into the sheet, the other way is to compose piece by piece our presentation and it is this option that will retain our favour. The result is similar to the difference loan that the solution with the image we consume a little more memory.

The size of the leaf will depend on elements that we will advertise and we will give it an approximate size while knowing that we can possibly change.
Looking at the map (Form1) you notice small black square located in the center of each side of the sheet. That is what we call handles that let you drag them to change the dimensions of each respective side of the sheet.

You have opportunities to control any time the dimensions that you attach to your leaf through the meter located in the toolbar.
We give value dimensions: 6195 x 3840.
To change the size of this window, use the mouse.
Put it on the lower right corner of the window (which has the effect of converting it into a double arrow oblique), press the left mouse button, move the pointer until the window reaches the desired dimensions , Then release the mouse and control the dimensions shown.

We have to modify the original values of the sheet manually, we could have done also through the window of properties.

III. The properties
III.1. It is complicated, what with properties?
Each object in Visual Basic has a set of characteristics, known properties associated with him. These properties listed in the Properties window, control the appearance and behaviour of the object.

Visual Basic assigns a default value the properties of each object. These values can be changed during the program design or active mode of application programming.
We are interested for the moment only properties that we will use.
Nevertheless, I advise you to try to familiarize yourself with all the properties of each object.

III.2. The property sheet
To view the Properties box,
 ,Click from the toolbar on the icon that represents a hand holding a file (2nd from left) or press the function key F4 on your keyboard.

In the fields at the top of the sheet, you read the sheet name which relate properties. It is in this example of the leaf Form1.

warning If I insist on this point is simply that when you have a programme which will contain a dozen leaves, it will show precisely leaf whose properties are to be amended. Do not cheat sheet!
We keep the option represented by the tab "Alphabetical"

 



The first property is to change the name:
Name: Form1 will be replaced by: frmAbout (Name of the sheet)

Then the other properties characteristics:
Backcolor: clicking on the square shaded we open the palette and we choose the background color desired. (Black)
BorderStyle: 2 – Sizable ie changed by the user will be replaced by: 1 – fix the user can not change the dimensions of the sheet.
Caption: Form1 will be replaced by: "About …". This entry fields corresponds to writing that is in the title bar of your sheet.
Icon: (Icon) allows you to insert an icon, any icon will be the case if it's an extension "*. ico"
Icon: Image File which includes an extension ico.
Height: 3840 – Dimensions in arrivals of the leaf
Width: 6195 – Dimensions width of the leaf
A new report by the first versions of VB the fields at the bottom of the property sheet that tells you the characteristics of the selected property.
In this example we explain the property caption
Each property to a value assigned by default and which is amendable at the option of a programmer.
This change may be underway programming as we shall see further.
The property Caption you can assign an access key to control.
In the legend, enter the sign & just before the character you want to designate as access key. This character will appear stressed. Simply press the ALT key and the underscore to place the focus on this control.
(we focus again in due course)

IV. Inserting objects
IV.1. The toolbox
 To select an item from the toolbox, move the mouse over the item you want to choose
an information bubble appears and tells you the name of the object on which you point the mouse.
We will position on the sheet other items necessary for the submission of our paper, namely:
* An object Label (Label1), which will serve as title
* An object Image (Image1) to insert your logo in the form of an icon
* A second object Label (Label2) which will indicate the version of the program
* Another Label (Label3), which indicate the use of the program
* Another image (Image2) to insert the logo in the form of an image of our structure
* A trait recovered in the toolbox
* Label (Label4) to give us the name of the program and its copyright
* Two buttons (CommandButton1 and CommandButton2)
* Another Label (Label5) will be used to label
* 2 last Labels (Label6 and Label7), which contain our serial number

IV.2. Creation of the interface
We will position on the working interface objects necessary for the submission of our paper, namely:

Label1 positioned in the upper left corner of the sheet, properties:
Height:
390
Width: 4630
Caption: Help System Restorer or the name of your choice
BackColor: Choosing a color Black
ForeColor: Choosing a color Rouge
These last two properties will be identical in all subject positioned in this sheet.

Label2 positioned just below the first label will include in its ownership:
Caption:
Version 1.0
I let you give it the proper dimensions

Label3 be placed below Label2 and will ownership:
Caption: Description of the application
Followed by:
Label4 with the property:
Caption: Programme backup of the registry, or descriptive depending on your choice.


Image1 will be placed right next to Label1 and its extension.
The properties dimensional adjust the dimensions of the image
We'll post the image file by clicking on the property Picture which has the effect of opening a dialog of Windows that lets you load the image of your choice format Bmp, Gif or wmf.

If you do not have "Logos" in the main download images and the example of the application: Download
We will insert an object Line (line) below the object Image1, without comment.

Label5, positioned below the trait will ownership:
Caption: Help System Restorer [Savereg] Copyright © 2001
All rights reserved Gilbert Miralles 30980 Langlade France
Ndl: It is of course that you can change the seizure by replacing your own details.
The acronym Copyright "©" is produced by pressing the Alt + 0169 alphanumeric keypad on the keypad.

All we have to position the last two "Label" that remain, namely:
Label6 which is a label that will ownership:
Caption: Serial No:
Label7qui will be juxtaposed with the label Label6 to receive the value of the serial number of your achievement.

Finally, we set the two buttons that will have as property:
CommandButton1
Caption: OK
CommandButton2
Caption: Information System …
You give them as dimensions of values in connection with the presentation of your paper.
You can enliven the presentation by changing the property "color" of certain texts.