[CoDe]Calculator[CoDe]
If you have completed an application and wish to share the complete source/project files with everyone then please post it in here. Source-code files only, no tutorials.
3 posts
Page 1 of 1
Calculator Requirments : 17 Buttons, 1 Textbox
Symbols Needed : ( ÷ = Divide) ( x = Times) ( - = Minus) ( + = Plus) ( . = Point)
* Make textbox1 text angle to right *
~~~~~~~~~~~~~~~~ CoDeS ~~ By : xCoDeRx ~~~~~~~~~~~~~~~
Public Class Form1![Image]()
Source Download : LOST SOURCE
Symbols Needed : ( ÷ = Divide) ( x = Times) ( - = Minus) ( + = Plus) ( . = Point)
* Make textbox1 text angle to right *
~~~~~~~~~~~~~~~~ CoDeS ~~ By : xCoDeRx ~~~~~~~~~~~~~~~
Public Class Form1
Code: Select all
Button1 ( 0 )
Dim operation As String = ""
Dim value1 As Double = 0
Dim value2 As Double = 0
Code: Select all
Button2 ( 1 )
TextBox1.Text += "0"
Code: Select all
Button3 ( 2 )
TextBox1.Text += "1"
Code: Select all
Button4 ( 3 )
TextBox1.Text += "2"
Code: Select all
Button5 ( 4 )
TextBox1.Text += "3"
Code: Select all
Button6 ( 5 )
TextBox1.Text += "4"
Code: Select all
Button7 ( 6 )
TextBox1.Text += "5"
Code: Select all
Button8 ( 7 )
TextBox1.Text += "6"
Code: Select all
Button9 ( 8 )
TextBox1.Text += "7"
Code: Select all
Button10 ( 9 )
TextBox1.Text += "8"
Code: Select all
Button11 ( C )
TextBox1.Text += "9"
Code: Select all
Button12 ( + )
TextBox1.Clear()
Code: Select all
Button13 ( - )
operation = "+"
If CInt(True) Then value1 = CDbl(TextBox1.Text)
TextBox1.Clear()
Code: Select all
Button14 ( x )
operation = "-"
If CInt(True) Then value1 = CDbl(TextBox1.Text)
TextBox1.Clear()
Code: Select all
Button15 ( . )
operation = "x"
If CInt(True) Then value1 = CDbl(TextBox1.Text)
TextBox1.Clear()
Code: Select all
Button16
Dim dot As Boolean
If TextBox1.Text.IndexOf(".") = 0 Then dot = True
If dot = False Then TextBox1.Text += "."
Code: Select all
Button17 ( = )
operation = "÷"
If CInt(True) Then value1 = CDbl(TextBox1.Text)
TextBox1.Clear()
Code: Select all
value2 = Val(TextBox1.Text)
Select Case operation
Case Is = "+"
TextBox1.Text = (value1 + value2).ToString()
Case Is = "-"
TextBox1.Text = (value1 - value2).ToString()
Case Is = "x"
TextBox1.Text = (value1 * value2).ToString()
Case Is = "÷"
TextBox1.Text = (value1 / value2).ToString()
End Select

Source Download : LOST SOURCE
Last edited by xCoDeRx on Sat Dec 04, 2010 10:51 pm, edited 1 time in total.
You must have posted a screenshot so members could see how to put the buttons on the form. Anyways good tutorial.
3 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023