Introduction to VISUAL BASIC
1- History of the Visual Basic programming language
The BASIC programming language (Beginner's All-purpose Symbolic Instruction Code)
created in the 1960s by researchers from Dartmouth University in New
Scotland. When it was created, the BASIC language was intended for beginners in programming,
where the word beginner comes from. With the appearance of the first home computers in the early
In the 80s, Bill Gates and Paul Allen adapted the BASIC language for microcomputers.
They then founded the company Microsoft to market this language.
The first PCs included a version of the Basic language, the first of which was GW-BASIC.
followed by QuickBasic and finally QBasic, all these versions being usable under DOS.
In the early 1990s with the Windows platform, the Visual Basic language emerged.
(VB) that allowed programmers to quickly create graphical interfaces of
Windows. Today, this language has only a few similarities with its
predecessor BASIC. It is an event-driven object-oriented language, easy to
use, even for an amateur, but which has become more and more over the years
sophisticated and bulky. It is currently a commonly used development tool.
by professional programmers. It remains an excellent learning tool.
programming and it allows you to become familiar with the various elements of the
object-oriented programming (classes, objects, properties, methods).
There are two derivatives of Visual Basic: VBA and VBScript. VBA (Visual Basic for
Applications) is a reduced variant of Visual Basic, used for task automation.
in Microsoft Office applications (Word, Excel, Access). VBScript is a language of
script mainly used on web servers and interpreted by the clients' browser.
I - The development environment ♪
2- The Development Environment
The integrated development environment of Visual Basic (IDE: Integrated Development
The environment can be customized in terms of its presentation and its mode of
functioning.
However, it is preferable to carry out a few before starting your first project.
settings :
1) In the menu bar, click on the 'Tools' label, then on 'Options' in the tab
"Editions" you check all the boxes except for "Display full module" and
in the width of the tab you enter the value '2'.
2) Select the 'General' tab, you change the grid unit values to '30'
3) Select the 'Anchoring' tab and uncheck all the checkboxes.
When you are more comfortable with your work environment, you will be able to adjust the
options to customize them to your liking.
We will see other interesting adjustments later.
3- Your first VISUAL BASIC project
3-1 Creation of the interface
Most applications created with Visual Basic have at least one form.
The sheets (Form in English) are the basic elements of the user interface.
They form the containers receiving controls, such as buttons,
text boxes, checkboxes, etc. that can be tailored to your abilities
creators.
When you started Visual Basic, the sheet editor window displays a sheet
video named Form1 (Name that you find in the title bar).
II-B - Define the size of the sheet
There are several ways to create our sheet, the easiest is to create an image and
incorporate it into the sheet, the other way is to compose our presentation piece by piece
it's this option that will hold our favor. The result is the same with the difference that the
solution with the image will consume a little more memory.
The size of the sheet will depend on the elements we are going to insert into it, and we will
give an approximate size while knowing that we may eventually it
modifier.
Looking at the sheet (Form1) you notice small black squares located in the center of
each side of the sheet.
These are called handles that allow you to change the
respective dimensions of each side of the sheet.
You have the ability to control at any time the dimensions you give to
your sheet through the counter located in the toolbar.
We will give it the dimensions of: 6195 x 3840.
To resize this window, use the mouse pointer.
Place it in the lower right corner of the window (which transforms it into a
double diagonal arrow), press the left mouse button, move the pointer
until the window reaches the desired dimensions, then release the mouse and
check the displayed dimensions.
We have just manually changed the initial values of the sheet, we could have done it.
also done through the properties window.
III - The Properties
III-A - What are properties?
Each object in Visual Basic has a set of characteristics, called properties, that it
are associated. These properties, listed in the Properties window, control the appearance and the
behavior of the object.
Visual Basic assigns a default value to the properties of each object. These values
can be modified during the program design or in the active mode of the application
by programming.
For now, we will only focus on the properties that we are going to use.
I still advise you to try out some tests to familiarize yourself with all the
properties of each object.