Welcome to the iTechForums.
If this is your first visit, be sure to check out the
FAQ by clicking the link above.
You may have to
register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
To register now click here.
|
Latest Threads
Advertisements
Forum Statistics
Threads:
Posts: 3
Members:
Number of Users Online:
Welcome to our newest member, |
|
 |

10-25-2009, 09:29 PM
|
|
Junior Member
|
|
Join Date: Oct 2009
Posts: 1
|
|
calculator in vb.net?
calculator in vb.net? i am trying to make a calculator in vb.net. all i did was design the interface, write the code for the buttons from 0 to 9, and the code for the plus button. now am stuck ! what am i supposed to write for the rest ? how will the numbers be added when i press the equal button ? my calculator has only got numbers from 0 to 9, a plus, equal and a clear button. please someone help me !
|

01-27-2010, 01:05 PM
|
|
Junior Member
|
|
Join Date: Jan 2010
Posts: 26
|
|
vb.net
vb.net You are saying, you have done the coding for all buttons. first check are all buttons working properly. After that, coding for clear button, use that code Text1.Text=" ".
second step, you have to use some variables to retain the values of numbers.
Like Dim total1 As Integer
code for sum
Private Sub btnPlus_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles btnPlus.Click
total1 = total1 + Val(txtDisplay.Text)
txtDisplay.Clear()
you can do the same for minus sign.try that code. Hope it will be helpful for your calculator project
|

01-27-2010, 01:08 PM
|
|
Junior Member
|
|
Join Date: Jan 2010
Posts: 26
|
|
you are saying, you have set the 0-9 number, first check are all number working properly. after that you can use that code for sum.
Private Sub btnPlus_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles btnPlus.Click
total1 = total1 + Val(txtDisplay.Text)
txtDisplay.Clear()
For clear text, use that code, txtDisplay.Text = ""
Hope it will be helpful for your calculator.
|
 |
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
All times are GMT. The time now is 03:38 AM.