How to build a simple calculator?
-
I had a problem. I had to create a simple calculator with VB.Net and this calculator had 0-9 buttons, add and minus function, a = button and a textbox for display of answer. I couldnt figure out the codings for the buttons. hope your can help me. thank you! =)
-
I had a problem. I had to create a simple calculator with VB.Net and this calculator had 0-9 buttons, add and minus function, a = button and a textbox for display of answer. I couldnt figure out the codings for the buttons. hope your can help me. thank you! =)
is this a home work ?? :cool:
Tamimi - Code
-
I had a problem. I had to create a simple calculator with VB.Net and this calculator had 0-9 buttons, add and minus function, a = button and a textbox for display of answer. I couldnt figure out the codings for the buttons. hope your can help me. thank you! =)
-
is this a home work ?? :cool:
Tamimi - Code
-
it too Simple and i will not tell u about it , think Alone
Mohamad A. Flefel
+962 79 5963865
C#.net Developeri think that that you to dont know how to do it :laugh::laugh::laugh::laugh:
Tamimi - Code
-
i think abo rami could !!!!!!!!!1
Tamimi - Code
-
i think abo rami could !!!!!!!!!1
Tamimi - Code
-
i think that that you to dont know how to do it :laugh::laugh::laugh::laugh:
Tamimi - Code
-
-_-".... ur r making things diff4 me.. n i'm a she not him. n yes, this is a homework. =p
try to do it by your self, when you facing a problem come back here and you will be answered
Tamimi - Code
-
I had a problem. I had to create a simple calculator with VB.Net and this calculator had 0-9 buttons, add and minus function, a = button and a textbox for display of answer. I couldnt figure out the codings for the buttons. hope your can help me. thank you! =)
You got the response you did because we don't do people's homework here. If you try to do your own homework, then we're happy to help with specifics.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog
-
try to do it by your self, when you facing a problem come back here and you will be answered
Tamimi - Code
hmmm... well... i have done the codings for each individual buttons. Eg for the button 9: Private Sub btn9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn9.Click TextBox1.Text = 9 temp = 9 End Sub However, I can't figure out what should the code of '+' be. Since when a user clicks on it, he/she will select another number button. So is it simply this: TextBox1.Text = Int(TextBox1.Text) + Int(TextBox1.Text)
-
hmmm... well... i have done the codings for each individual buttons. Eg for the button 9: Private Sub btn9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn9.Click TextBox1.Text = 9 temp = 9 End Sub However, I can't figure out what should the code of '+' be. Since when a user clicks on it, he/she will select another number button. So is it simply this: TextBox1.Text = Int(TextBox1.Text) + Int(TextBox1.Text)
-
-_-".... ur r making things diff4 me.. n i'm a she not him. n yes, this is a homework. =p
hi ( SHE ) u had entered a programmers site u can't ask questions like this
Mohamad A. Flefel mflefel@hotmail.com C#.net Developer
-
hi ( SHE ) u had entered a programmers site u can't ask questions like this
Mohamad A. Flefel mflefel@hotmail.com C#.net Developer
-
i had made a sample calculater i can send it to u its code is very easy
Mohamad A. Flefel mflefel@hotmail.com +962 79 5963865 C#.net Developer
-
i had made a sample calculater i can send it to u its code is very easy
Mohamad A. Flefel mflefel@hotmail.com +962 79 5963865 C#.net Developer
-
i had made a sample calculater i can send it to u its code is very easy
Mohamad A. Flefel mflefel@hotmail.com +962 79 5963865 C#.net Developer
ok , here is my e-mail u can ask for help any time :)
Mohamad A. Flefel mflefel@hotmail.com +962 79 5963865 C#.net Developer
-
ok , here is my e-mail u can ask for help any time :)
Mohamad A. Flefel mflefel@hotmail.com +962 79 5963865 C#.net Developer
dont ever put you email on a fourm :suss:
Tamimi - Code
-
ok , here is my e-mail u can ask for help any time :)
Mohamad A. Flefel mflefel@hotmail.com +962 79 5963865 C#.net Developer
=) thank you. i have done the codings for each individual buttons. Eg for the button 9: Private Sub btn9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn9.Click TextBox1.Text = 9 temp = 9 End Sub However, I can't figure out what should the code of '+' be. Since when a user clicks on it, he/she will select another number button. So is it simply this: TextBox1.Text = Int(TextBox1.Text) + Int(TextBox1.Text)
-
=) thank you. i have done the codings for each individual buttons. Eg for the button 9: Private Sub btn9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn9.Click TextBox1.Text = 9 temp = 9 End Sub However, I can't figure out what should the code of '+' be. Since when a user clicks on it, he/she will select another number button. So is it simply this: TextBox1.Text = Int(TextBox1.Text) + Int(TextBox1.Text)
Here are some pointers: You need to hold some state somewhere. You also need to hold the fact that the user can type numbers like 98 (the code you showed does not append more digits, it replaces them). When a use clicks on an operator button (+-/*=) the program needs to store the current display, then it needs to accept a new number. When the user next pressed an operator it performs the function of the operator on the stored value and the current value. When a user clicks on a digit button it has to append the value on to the other digits received.
Upcoming Scottish Developers events: * UK Security Evangelists On Tour (2nd November, Edinburgh) * Developer Day Scotland: are you interested in speaking or attending? My: Website | Blog