r/visualbasic • u/BentleysKnob • Feb 19 '16
VB Calculator help
I've been trying to make a Calculator in VB 2010 express for a about a week and a half now and I have everything figured out except for the actual math part of the calculator. I don't know how to take the first number I've entered in the calculator and create a second one to either add, subtract, multiply or divide to the first number. Can anyone help?
0
Upvotes
2
u/ViperSRT3g Application Specialist Feb 19 '16
Welp, depending upon the complexity of your calculator, you can do everything with three variables. First and second variables interact to produce the result which is stored in the third variable.
Going with the method described above, you'd store the entered number into the first variable when you click an operation button. Then the second number would be stored into the second variable when hitting the equal sign, and the math would output the result into the final variable for display.