Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Visual Basic (https://www.askmehelpdesk.com/forumdisplay.php?f=469)
-   -   My vb calculator did not work when ay inter the number so my code is (https://www.askmehelpdesk.com/showthread.php?t=568818)

  • Apr 8, 2011, 07:14 AM
    bashiir
    my vb calculator did not work when ay inter the number so my code is
    Text1.Text = "1"
    End Sub

    Private Sub cmd8_Click()
    Text1.Text = "2"
    End Sub

    Private Sub cmd9_Click()
    Text1.Text = "3"
    End Sub

    Private Sub cmdadd_Click()
    num1 = Text1.Text
    Text1.Text = ""
    op = "+"
    End Sub

    Private Sub cmdclear_Click()
    Text1.Text = ""
    End Sub

    Private Sub cmddivid_Click()
    num1 = Text1.Text
    Text1.Text = ""
    op = "/"
    End Sub

    Private Sub cmdequal_Click()
    num2 = Text1.Text
    If op = "+" Then
    Text1.Text = num1 + num2
    ElseIf op = "-" Then
    Text1.Text = num1 - num2
    ElseIf op = "*" Then
    Text1.Text = num1 * num2
    ElseIf op = "/" Then
    Text1.Text = num1 / num2
    End If
    End Sub

    Private Sub cmdminus_Click()
    num1 = Text1.Text
    Text1.Text = ""
    op = "-"
    End Sub

    Private Sub cmdmult_Click()
    num1 = Text1.Text
    Text1.Text = ""
    op = "*"
    End Sub
    what can I do?

  • All times are GMT -7. The time now is 04:22 AM.