| | |
My Calculator
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Dec 2008
Posts: 1
Reputation:
Solved Threads: 0
I made a Calculator with 3 Textboxes (the First 2 for the Variables the Third for the Result) and 4 buttons (+, -, *, /) and the code i used for the subtraction button was:
But Heres all my Code:
And i used 02 + 04 and i got it to = 6
Its not the most Advanced Calculator but I was board one day
VB.NET Syntax (Toggle Plain Text)
TextBox3.Text = Val(TextBox1.Text) - Val(TextBox2.Text)
But Heres all my Code:
•
•
•
•
Private Sub CloseToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CloseToolStripMenuItem.Click
'Closes Form
Me.Close()
End Sub
Private Sub AboutToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AboutToolStripMenuItem.Click
'Shows Form2 or the About Form
Form2.Show()
End Sub
Private Sub HelpToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HelpToolStripMenuItem1.Click
'Shows Form3 or the Help Form
Form3.Show()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Add Button
TextBox3.Text = Val(TextBox1.Text) + Val(TextBox2.Text)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
'Subtract Button
TextBox3.Text = Val(TextBox1.Text) - Val(TextBox2.Text)
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
'Multiply Button
TextBox3.Text = Val(TextBox1.Text) * Val(TextBox2.Text)
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
'Divide Button
TextBox3.Text = Val(TextBox1.Text) / Val(TextBox2.Text)
End Sub
End Class
Its not the most Advanced Calculator but I was board one day
Last edited by Gwen203; Dec 3rd, 2008 at 7:24 pm. Reason: Edit
Hi,
Not bad for a start but I have attached a full calc. code as a gift.
Not bad for a start but I have attached a full calc. code as a gift.
It is never about the number of languages you know, you either have the logic of programming or you don't ...
Some of the codes I post are collected from different sites during the past couple of years, so I would like to thank them for their help and for enabling me to help.
Some of the codes I post are collected from different sites during the past couple of years, so I would like to thank them for their help and for enabling me to help.
![]() |
Similar Threads
- How to re-install software, I have lost my Calculator!! (OS X)
- Need help with commission calculator (Java)
- The Calculator (C++)
Other Threads in the VB.NET Forum
- Previous Thread: ORACLE
- Next Thread: Help with Advancing to Next Record, read line continued iteration problem
| Thread Tools | Search this Thread |
"crystal .net .net2005 30minutes 2005 2008 access arithmetic array assignment basic binary bing box button buttons center check code combobox component connectionstring convert cpu crystalreport data database databasesearch datagrid datagridview design dissertation dissertations dissertationthesis dosconsolevb.net dropdownlist editvb.net employees excel file-dialog firewall folder ftp google hardcopy image images isnumericfuntioncall login math memory mobile ms mssqlbackend mysql navigate net networking opacity output peertopeervideostreaming picturebox1 port print printpreview problemwithinstallation project record reports" reuse save savedialog searchbox serial soap storedprocedure string tcp temp text textbox timer toolbox trim updown useraccounts usercontrol vb vb.net vb.netcode vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet view visual visualbasic visualbasic.net visualstudio web wpf





