In order to add in a calculator you need to first enter the first number then click "+" and enter the second number. My problem is that when the user clicks "+" the text box will be set to "". So how can I add the second number
Printable View
In order to add in a calculator you need to first enter the first number then click "+" and enter the second number. My problem is that when the user clicks "+" the text box will be set to "". So how can I add the second number
Store the first number in a variable, then store the second number in another variable... then add them and display in the textbox :thumb:
VB Code:
Private Function Example() Dim FirstNum, SecondNum As Integer FirstNum = "0" SecondNum = "0" FirstNum = Text1 ' do whatever to textbox and then add other number SecondNum = Text1 Msgbox FirstNum + SecondNum end function
something like that should do fine...didn't try it in VB yet, so good luck ;)
Have a look at the calculator that comes with VB6. :thumb: