Public Sub Calcu()
Select Case signo
Case "+"
// aqui me debe sumas mas de dos numeros
TextBox1.Text = operacion1 + operacion2
Case "-"
// aqui me debe restar mas de dos numeros
TextBox1.Text = operacion1 - operacion2
Case "*"
// aqui me debe multiplicar mas de dos numeros
TextBox1.Text = operacion1 * operacion2
Case "/"
TextBox1.Text = operacion1 / operacion2
Case "raiz"
TextBox1.Text = operacion1 ^ (1 / 2)
Case "exponente"
TextBox1.Text = operacion1 ^ operacion2
Case "%"
TextBox1.Text = operacion1 * operacion2 / 100
End Select
End Sub
Public Sub cocncatenar()
If bandera = True Then
TextBox1.Text = ""
bandera = False
End If
End Sub
Private Sub Button20_Click(sender As Object, e As EventArgs) Handles Button20.Click
cocncatenar()
If Button1.Enabled = True Then
TextBox1.Text = TextBox1.Text & "1"
End If
End Sub
Private Sub Button19_Click(sender As Object, e As EventArgs) Handles Button19.Click
cocncatenar()
If Button1.Enabled = True Then
TextBox1.Text = TextBox1.Text & "2"
End If
End Sub
Private Sub Button18_Click(sender As Object, e As EventArgs) Handles Button18.Click
cocncatenar()
If Button1.Enabled = True Then
TextBox1.Text = TextBox1.Text & "3"
End If
End Sub
Private Sub Button15_Click(sender As Object, e As EventArgs) Handles Button15.Click
cocncatenar()
If Button1.Enabled = True Then
TextBox1.Text = TextBox1.Text & "4"
End If
End Sub
Private Sub Button14_Click(sender As Object, e As EventArgs) Handles Button14.Click
cocncatenar()
If Button1.Enabled = True Then
TextBox1.Text = TextBox1.Text & "5"
End If
End Sub
Private Sub Button13_Click(sender As Object, e As EventArgs) Handles Button13.Click
cocncatenar()
If Button1.Enabled = True Then
TextBox1.Text = TextBox1.Text & "6"
End If
End Sub
Private Sub Button10_Click(sender As Object, e As EventArgs) Handles Button10.Click
cocncatenar()
If Button1.Enabled = True Then
TextBox1.Text = TextBox1.Text & "7"
End If
End Sub
Private Sub Button9_Click(sender As Object, e As EventArgs) Handles Button9.Click
cocncatenar()
If Button1.Enabled = True Then
TextBox1.Text = TextBox1.Text & "8"
End If
End Sub
Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click
cocncatenar()
If Button1.Enabled = True Then
TextBox1.Text = TextBox1.Text & "9"
End If
End Sub
Private Sub Button25_Click(sender As Object, e As EventArgs) Handles Button25.Click
cocncatenar()
If Button1.Enabled = True Then
TextBox1.Text = TextBox1.Text & "0"
End If
End Sub
Private Sub Button23_Click(sender As Object, e As EventArgs) Handles Button23.Click
If InStr(TextBox1.Text, ".", CompareMethod.Text) = 0 Then
TextBox1.Text = TextBox1.Text & "."
End If
End Sub
Private Sub Button22_Click(sender As Object, e As EventArgs) Handles Button22.Click
If TextBox1.Text <> "" Then
operacion1 = Val(TextBox1.Text)
signo = "+"
bandera = True
End If
End Sub
Private Sub Button17_Click(sender As Object, e As EventArgs) Handles Button17.Click
If TextBox1.Text <> "" Then
operacion1 = Val(TextBox1.Text)
signo = "-"
bandera = True
End If
End Sub
Private Sub Button12_Click(sender As Object, e As EventArgs) Handles Button12.Click
If TextBox1.Text <> "" Then
operacion1 = Val(TextBox1.Text)
signo = "*"
bandera = True
End If
End Sub
Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
If TextBox1.Text <> "" Then
operacion1 = Val(TextBox1.Text)
signo = "/"
bandera = True
End If
End Sub
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
If TextBox1.Text <> "" Then
operacion1 = Val(TextBox1.Text)
signo = "raiz"
bandera = True
End If
End Sub
Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
If TextBox1.Text <> "" Then
operacion1 = Val(TextBox1.Text)
signo = "exponente"
bandera = True
End If
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
If TextBox1.Text <> "" Then
operacion1 = Val(TextBox1.Text)
signo = "%"
bandera = True
End If
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
TextBox1.Clear()
operacion1 = 0.0
operacion2 = 0.0
signo = String.Empty
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Try
Dim lange As Integer
If TextBox1.Text <> "" Then
lange = TextBox1.Text.Length
TextBox1.Text = Mid(TextBox1.Text, 1, lange - 1)
End If
Catch ex As Exception
End Try
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
Try
If TextBox1.Text <> "" Then
TextBox1.Text = TextBox1.Text * -1
End If
Catch ex As Exception
End Try
End Sub
Private Sub Button11_Click(sender As Object, e As EventArgs) Handles Button11.Click
Try
If TextBox1.Text <> "" Then
TextBox1.Text = 1 / (TextBox1.Text)
End If
Catch ex As Exception
End Try
End Sub
Private Sub Button16_Click(sender As Object, e As EventArgs) Handles Button16.Click
If TextBox1.Text <> "" And operacion1 <> 0.0 Then
operacion2 = TextBox1.Text
Calcu()
End If
End Sub
End Class