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
Sitting w/ Bob Status: -Next -To- Null- Friend: Philip
Posts
1,152
Re: Calculator
Store the first number in a variable, then store the second number in another variable... then add them and display in the textbox
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
:::`DISCLAIMER`:::
Do NOT take anything i have posted to be truthful in any way, shape or form.
Thank You!
-------------------------------- "Never heard about "hiking" poles. I usualy just grab a stick from the nature, and use that as a pole." - NoteMe "Finaly I can look as gay as I want..." - NoteMe
Languages: VB6, BASIC, Java, C#. C++
Have a look at the calculator that comes with VB6.
Keith
I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.