VB adding calculator

Page 1 of 1

1 Replies - 517 Views - Last Post: 13 February 2013 - 02:18 PM Rate Topic: -----

#1 mbilal1  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 20-September 12

VB adding calculator

Posted 13 February 2013 - 02:14 PM

Iím reposting this because I believe that I posted it in the wrong section earlier? This is for Visual Basic Studio. Okay so I want to make an adding machine. Iíve got the layout set with buttons from 0-9 and a + and Ė button and a clear and exit button. The clear and exit buttons work, and the number buttons are now displayed onto the result text field. Here are the clear, exit, and one of the number buttons.


Private Sub btnClear_Click(sender As Object,e As EventArgs) HandlesbtnClear.Click
  txtResult.Clear()
End Sub
	 
Private Sub btnExit_Click(sender As Object, e As EventArgs) HandlesbtnExit.Click
  Me.Close()
End Sub

Private Sub btn1_Click(sender As Object, e As EventArgs) Handles btn1.Click
  txtBox.Text="1"   
End Sub



What Iím not sure is how would I make it so that when I click a button, it gives that value to a variable. Then when I click either add or subtract, it will add or subtract it to the next number button I click. Do I make a loop or something? I have never learned VB or C, I only know java so Iím not really sure how you declare variables and write the arithmetic so any help would be highly appreciated.

Is This A Good Question/Topic? 0
  • +

Replies To: VB adding calculator

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9286
  • View blog
  • Posts: 34,804
  • Joined: 12-June 08

Re: VB adding calculator

Posted 13 February 2013 - 02:18 PM

Yes.. you had put it in VB6 earlier, and I moved it to where it should go: VB.NEt. Closing duplicate topic.

http://www.dreaminco...ing-calculator/
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1