Computer Science Canada

Calculator Help

Author:  pari [ Wed May 11, 2011 1:02 pm ]
Post subject:  Calculator Help

Hey can you please tell me how to add plus Functionality to my Calculator?

VisualBASIC:

    Private Sub cmdPlus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdPlus.Click
        num1 = txtC.Text
        havenum = True
        txtC.Text = " "
        'txtC.Text = num1 + num2




    End Sub

Author:  william 01 [ Wed May 11, 2011 1:09 pm ]
Post subject:  Re: Calculator Help

hi pari

Author:  mirhagk [ Wed May 11, 2011 1:15 pm ]
Post subject:  RE:Calculator Help

it looks like your adding strings, not 100% sure if you are or not but if you are then you need to convert to an integer (or something else that stores a number)

Author:  pari [ Wed May 11, 2011 1:56 pm ]
Post subject:  Re: Calculator Help

hey can u please then help me with my Equal button becouse im writing this code but its not working
VisualBASIC:

Private Sub cmdEqual_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdEqual.Click
        num1 = Double.Parse(txtC.Text)
        txtC.Text = " "
        op = "="
    End Sub

Author:  2goto1 [ Wed May 11, 2011 2:54 pm ]
Post subject:  RE:Calculator Help

Is there an error message? If so, what is the error message?

Or are you expecting the equal button to do something when clicked that it's not at this time?


: