سوال یک تازه کار

Shayan1226

کاربر تازه وارد
تازه وارد
با سلام خدمت اساتید

بنده قصدم اینه که از صفر یک نرم افزار ماشین حساب (ابتدا ساده و بعد پیشرفته کامل) بنویسم.

حالا توی کد هایی که نوشتم فقط "عمل جمع" بدرستی کار میکنه و تقسیم و ضرب که اصلا 0 جواب میدن، تفریق هم یکی بار در میان +/- یک جواب غلط میده.

کد:
Public Class Form1

    Dim TotalNum As Double
    Dim TotalEqual As Double

    Private Sub BackSpace_Btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BackSpace_Btn.Click
        Dim bs As Integer
        If Result_Label.Text.Length > 0 Then
            bs = Result_Label.Text.Length
            Result_Label.Text = Result_Label.Text.Remove(bs - 1, 1)
        Else
            Result_Label.Text = ""
        End If
    End Sub

    Private Sub Key1_Btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Key1_Btn.Click
        Result_Label.Text = Result_Label.Text & 1
    End Sub

    Private Sub Key2_Btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Key2_Btn.Click
        Result_Label.Text = Result_Label.Text & 2
    End Sub

    Private Sub Key3_Btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Key3_Btn.Click
        Result_Label.Text = Result_Label.Text & 3
    End Sub

    Private Sub Key4_Btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Key4_Btn.Click
        Result_Label.Text = Result_Label.Text & 4
    End Sub

    Private Sub Key5_Btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Key5_Btn.Click
        Result_Label.Text = Result_Label.Text & 5
    End Sub

    Private Sub Key6_Btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Key6_Btn.Click
        Result_Label.Text = Result_Label.Text & 6
    End Sub

    Private Sub Key7_Btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Key7_Btn.Click
        Result_Label.Text = Result_Label.Text & 7
    End Sub

    Private Sub Key8_Btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Key8_Btn.Click
        Result_Label.Text = Result_Label.Text & 8
    End Sub

    Private Sub Key9_Btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Key9_Btn.Click
        Result_Label.Text = Result_Label.Text & 9
    End Sub

    Private Sub Key0_Btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Key0_Btn.Click
        Result_Label.Text = Result_Label.Text & 0
    End Sub

    Private Sub KeyDot_Btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KeyDot_Btn.Click
        Result_Label.Text = Result_Label.Text & "."
    End Sub

    Private Sub C_Btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles C_Btn.Click
        Result_Label.Text = ""
    End Sub

    Private Sub Off_Btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Off_Btn.Click
        End
    End Sub

    Private Sub Plus_Btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Plus_Btn.Click
        TotalNum = TotalNum + Val(Result_Label.Text)
        Result_Label.Text = Nothing
        CMD_Label.Text = "+"

    End Sub

    Private Sub Multiplication_Btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Multiplication_Btn.Click
        TotalNum = TotalNum * Val(Result_Label.Text)
        Result_Label.Text = Nothing
        CMD_Label.Text = "×"
    End Sub

    Private Sub Subtraction_Btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Subtraction_Btn.Click
        TotalNum = TotalNum - Val(Result_Label.Text)
        Result_Label.Text = Nothing
        CMD_Label.Text = "-"
    End Sub

    Private Sub Division_Btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Division_Btn.Click
        TotalNum = TotalNum / Val(Result_Label.Text)
        Result_Label.Text = Nothing
        CMD_Label.Text = "÷"
    End Sub

    Private Sub GetResult_Btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GetResult_Btn.Click
        If CMD_Label.Text.Contains("+") Then
            TotalEqual = TotalNum + Val(Result_Label.Text)
            Result_Label.Text = TotalEqual
            TotalNum = Nothing
        ElseIf CMD_Label.Text.Contains("×") Then
            TotalEqual = TotalNum * Val(Result_Label.Text)
            Result_Label.Text = TotalEqual
            TotalNum = Nothing

        ElseIf CMD_Label.Text.Contains("-") Then
            TotalEqual = TotalNum - Val(Result_Label.Text)
            Result_Label.Text = TotalEqual
            TotalNum = Nothing

        ElseIf CMD_Label.Text.Contains("÷") Then
            TotalEqual = TotalNum / Val(Result_Label.Text)
            Result_Label.Text = TotalEqual
            TotalNum = Nothing

        Else

        End If


    End Sub
End Class

در وحله اول مشکل اینا چیه؟
 
بالا