Hey, im just messing around with Visual Studio 2003 & 2005, trying to get better for my uni course.
And I have already hit a snag making a calculator. So basically this plee goes out to almost anyone who can programme in VB.
My problem is with the souly Equals button (I think)
What I want to know is how I would get pressing equals to complete ALL forms of mathamatical equations e.g. Addition, Multiplication, devision etc etc.
total1
total2
I declared at the beggining so everything can access them. Total1 for the addition is "total1 = total1 + Val(lblDisplay.Text)" but obviousely could be abything I wanted it to be, im my case I am using it as a running total.
As far as I can get with the multiply is this
Thanks
Jon
And I have already hit a snag making a calculator. So basically this plee goes out to almost anyone who can programme in VB.
My problem is with the souly Equals button (I think)
Thats the code. Its great for addition but as you can see thats because it has the + sign in.total2 = total1 + Val(lblDisplay.Text)
lblDisplay.Text = total2
total1 = 0
What I want to know is how I would get pressing equals to complete ALL forms of mathamatical equations e.g. Addition, Multiplication, devision etc etc.
total1
total2
I declared at the beggining so everything can access them. Total1 for the addition is "total1 = total1 + Val(lblDisplay.Text)" but obviousely could be abything I wanted it to be, im my case I am using it as a running total.
As far as I can get with the multiply is this
Think thats right, so just need help with this equals sign thing.total1 = total1 * Val(lblDisplay.Text)
lblDisplay.Text = ""
Thanks
Jon
