[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
Contributors
User avatar
xCoDeRx
Just Registered
Just Registered
Posts: 3
Joined: Fri Nov 19, 2010 10:59 pm

[CoDe]Calculator[CoDe]
xCoDeRx
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
Code: Select all
Dim operation As String = ""
    Dim value1 As Double = 0
    Dim value2 As Double = 0
Button1 ( 0 )
Code: Select all
TextBox1.Text += "0"
Button2 ( 1 )
Code: Select all
TextBox1.Text += "1"
Button3 ( 2 )
Code: Select all
TextBox1.Text += "2"
Button4 ( 3 )
Code: Select all
TextBox1.Text += "3"
Button5 ( 4 )
Code: Select all
TextBox1.Text += "4"
Button6 ( 5 )
Code: Select all
TextBox1.Text += "5"
Button7 ( 6 )
Code: Select all
TextBox1.Text += "6"
Button8 ( 7 )
Code: Select all
TextBox1.Text += "7"
Button9 ( 8 )
Code: Select all
TextBox1.Text += "8"
Button10 ( 9 )
Code: Select all
TextBox1.Text += "9"
Button11 ( C )
Code: Select all
TextBox1.Clear()
Button12 ( + )
Code: Select all
operation = "+"
        If CInt(True) Then value1 = CDbl(TextBox1.Text)
        TextBox1.Clear()
Button13 ( - )
Code: Select all
operation = "-"
        If CInt(True) Then value1 = CDbl(TextBox1.Text)
        TextBox1.Clear()
Button14 ( x )
Code: Select all
operation = "x"
        If CInt(True) Then value1 = CDbl(TextBox1.Text)
        TextBox1.Clear()
Button15 ( . )
Code: Select all
 Dim dot As Boolean
        If TextBox1.Text.IndexOf(".") = 0 Then dot = True
        If dot = False Then TextBox1.Text += "."
Button16
Code: Select all
operation = "÷"
        If CInt(True) Then value1 = CDbl(TextBox1.Text)
        TextBox1.Clear()
Button17 ( = )
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
Image

Source Download : LOST SOURCE
Last edited by xCoDeRx on Sat Dec 04, 2010 10:51 pm, edited 1 time in total.
User avatar
16namhcaz
Just Registered
Just Registered
Posts: 4
Joined: Wed Nov 24, 2010 6:16 am

Re: [CoDe]Calculator[CoDe]
16namhcaz
much stuff here
time to go through this :)
User avatar
Usman55
VIP - Site Partner
VIP - Site Partner
Posts: 2821
Joined: Thu Dec 24, 2009 7:52 pm

Re: [CoDe]Calculator[CoDe]
Usman55
You must have posted a screenshot so members could see how to put the buttons on the form. Anyways good tutorial.
Image
3 posts Page 1 of 1
Return to “Source-Code”