In today's tutorial we are going to see the most basic program that is : Calculator,
So this tutorial is on creating a simple calculator in visual basic which performs the most basic arithmetic function like addition,subtraction,multiplication & division.
Lets start with creating a new project in visual basic choose windows form application and name your project whatever you want.
Designing the GUI of Calculator:
Add 17 buttons and a textbox.
Now change the text of buttons as specified below :
Button1 - 1
Button2 - 2
Button3 - 3
Button4 - 4
Button5 - 5
Button6 - 6
Button7 - 7
Button8 - 8
Button9 - 9
Button10 - 0
Button11 - .
Button12 - C
Button13 - +
Button14 - -
Button15 - X
Button16 - /
Button17 - =
Double click your form to switch to code view, clear all the code & paste the below code:
Now run your project and your most basic calculator is ready to perform basic calculations.
If you like the tutorial, Then do share :)
Subscribe to:
Post Comments
(
Atom
)
0 replies:
Post a Comment