Keys.Enter bEqual_Click(sender, e) Case Keys.Add bOPPlus_Click(sender, e) Case Keys.Subtract bOPMinus_Click(sender, e) Case Keys.Multiply bOPTimes_Click(sender, e) Case Keys.Divide bOPDivide_Click(sender, e) Case Keys.Decimal bNPComma_Click(sender, e) Case Keys.Escape bC_Click(sender, e) Case Keys.Delete bCE_Click(sender, e) Case Keys.Back Button1_Click(sender, e) End Select End Sub Public Sub Calc_AppendNumber(ByVal Numero As String) If Operation = "" Then If Len(OperadorA) < 10 Then OperadorA = OperadorA + Numero CalcDisplay.Text = CStr(CDbl(OperadorA)) Else If Len(OperadorB) < 10 Then OperadorB = OperadorB + Numero CalcDisplay.Text = CStr(CDbl(OperadorB)) End If End Sub Private Sub bNP0_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bNP0.Click Calc_AppendNumber("0") End Sub Private Sub bNP1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bNP1.Click Calc_AppendNumber("1") End Sub Private Sub bNP2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bNP2.Click Calc_AppendNumber("2") End Sub Private Sub bNP3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bNP3.Click Calc_AppendNumber("3") End Sub Private Sub bNP4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bNP4.Click Calc_AppendNumber("4") End Sub Private Sub bNP5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bNP5.Click Calc_AppendNumber("5") End Sub Private Sub bNP6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bNP6.Click Calc_AppendNumber("6") End Sub Private Sub bNP7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bNP7.Click Calc_AppendNumber("7") End Sub Private Sub bNP8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bNP8.Click Calc_AppendNumber("8") End Sub Private Sub bNP9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bNP9.Click Calc_AppendNumber("9") End Sub Private Sub bNPComma_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bNPComma.Click If Operation = "" Then If InStr(OperadorA, ",") = 0 Then OperadorA = OperadorA + "," CalcDisplay.Text = CStr(CDbl(OperadorA)) End If Else If InStr(OperadorB, ",") = 0 Then OperadorB = OperadorB + "," CalcDisplay.Text = CStr(CDbl(OperadorB)) End If End If End Sub Private Sub bCE_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bCE.Click If Operation = "" Then OperadorA = "" CalcDisplay.Text = CStr(CDbl(CorrigeOperador(OperadorA))) Else OperadorB = "" CalcDisplay.Text = CStr(CDbl(CorrigeOperador(OperadorB))) End If End Sub Function CorrigeOperador(ByVal operador As String) As String If operador = "" Then CorrigeOperador = "0" Else CorrigeOperador = operador End If End Function Private Sub bC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bC.Click OperadorA = "" OperadorB = "" Operation = "" : bOperation.Text = Operation CalcDisplay.Text = CStr(CDbl(CorrigeOperador(OperadorA))) End Sub Private Sub CalcDisplay_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles CalcDisplay.GotFocus CalcDisplay.SelectionLength = 0 End Sub Sub FazOperacao(ByVal Operacao As String) If Operation = "" Then Operation = Operacao : bOperation.Text = Operation ElseIf OperadorB = "" Then Operation = Operacao : bOperation.Text = Operation Else FazIgualdade() End If End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Operation = "" Then If Len(OperadorA) > 0 Then OperadorA = Mid(OperadorA, 1, Len(OperadorA) - 1) CalcDisplay.Text = CStr(CDbl(CorrigeOperador(OperadorA))) Else If Len(OperadorB) > 0 Then OperadorB = Mid(OperadorB, 1, Len(OperadorB) - 1) CalcDisplay.Text = CStr(CDbl(CorrigeOperador(OperadorB))) End If End Sub Private Sub bOPPlus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bOPPlus.Click FazOperacao("+") End Sub Private Sub bOPMinus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bOPMinus.Click FazOperacao("-") End Sub Private Sub bOPTimes_Click(ByVal sender As System.Object,