Practical No. 1
Aim: Introduction
to Visual Basic.
Theory:To open visual basic in windows 7, go to start menu and
u will find “Microsoft visual basic”
Click on it
to open.
After that,
you will see an interface like shown below:
After that,
just click on New project then you
will get to new window shown below:
Now click on “windows
forms application”and click on OK button.
The window
that opens up is the window where you design your own application. On left side
of your Window you will see toolbox from where you can add any tool to your Form.
By using Text property
from the property window we can
change the Name of particular Attribute.
After Click on start debugging or F5 button we will get to a new page.
The window that opens up shown above is your
application interface.
Practical
No. 2
Aim: To calculate
the sum of two numbers.
Theory: As we discussed in 1st practical
about the basics of Visual basic. Now let’s make a simple vb.net program of sum
of two numbers.
For that we have to drag and
release three text boxes, three labels and one Command button and change the
caption by using the property window as shown below:-
After that just double click
on SUM command button then you will
get to the code module of your program. Shown Below:-
This is the code module where
you can do coding of your application. For add two numbers take a, b, c as
integers then A as text box 1, B as text box 2, c = a + b, C as text box 3 see
below:-
After that click on start
debugging or F5 to check whether application is working or not:-
Your application form opens up
now you can put any value in text box 1 and 2 and click on SUM button:-
The application of Addition of
two numbers is working.
Practical No. 3
Aim: To swap two numbers.
Theory:
To make program for swap
two numbers by using third variable we have to drag and release two labels,
three text boxes and one command button and name them by using caption or text
property shown below:-
Now double click on SWAP command button to open code module
as shown:-
Type command for swapping the
numbers as shown in figure below:-
After type the command, click on
Start Debugging option to test the Application:-
The Application form window
opens up now you can type the numbers in Textbox1
and Textbox2 to
Swap numbers between them:-
As I have taken Example As
value of A as 5 and value of B as 6 now click on SWAP to swap between them:-
Now the value of A and Value
of B are interchanged so that it means the program is working successfully.
Practical No. 4
Aim: Write a program to check whether a person can vote or not.
Theory: To make this program you have to take one label box, one text box and
one command button and name them from the caption
or text property as shown below:-
After that, Double click on CHECK command button to open the code module:-
The code module
opens up now just type the command as shown below in figure to make the command
button working:-
After that, click
on start debugging option to run your application and check if it’s properly
working or not:-
Type in the text
box 1 your Age to check if you can vote or not as shown below in figure:-
It means your
Application for check whether you can vote or not is working properly.
No comments:
Post a Comment