02:02AM Dj Prajeeth
MAKE A PROJECT OF CALCULATOR IN VISUAL BASIC
Ø
First we
select the Standard exe item in the view project dialog box, opening Visual Basic itself.
Ø
Then we
select the Textbox from the Toolbox and make a textbox on the form.
Ø
Then we
select the command button from the tool box from the tool box we make buttons 0,
1, 2, 3, 4 … 9, +, =,-,*, /, clear.
Ø After these all buttons are made. Then we need the buttons to be coded. Thus double click on the button numbered "1”, following coding is done:
Private sub Command 1-Click ()
Text1.Text
= Text 1. Text + "1”
End Sub
Ø Double clicking on the Button "2”
Private sub Command 2-Click ()
Text1.Text
= Text 1. Text + "2”
End Sub
Ø Double clicking on the Button "3”
Private sub Command 3-Click ()
Text1.Text
= Text 1. Text + "3”
End Sub
Ø Double clicking on the Button "4”
Text1.Text =
Text 1. Text + "4”
End Sub
Private sub Command 5-Click ()
Text1.Text = Text 1. Text
+ "5”
End Sub
Private sub Command 6-Click ()
Text1.Text
= Text 1. Text + "6”
End Sub
Private sub Command 7-Click ()
Text1.Text
= Text 1. Text + "7”
End Sub
Private sub Command 8-Click ()
Text1.Text
= Text 1. Text + "8”
End Sub
Private sub Command 9-Click ()
Text1.Text
= Text 1. Text + "9”
End Sub
Text1.Text
= Text 1. Text + "0”
End Sub
Text1.Text
= Text 1. Text + ".”
End Sub
a= Text 1.
Text
Text1.Text
= ”+”
d=1
End Sub
a= Text 1.
Text
Text1.Text
=”-”
d=3
End Sub
Ø Double clicking on the Button "*”
a= Text 1.
Text
Text1.Text
=”*”
d=3
End Sub
a= Text 1.
Text
Text1.Text
=”/”
d=4
End Sub
continue 2nd lessons........ go to next page..... Visual basic **2




