Codigos para Calculadora V.B 2010
Codigos para Calculadora V.B 2010
Codigos para Calculadora V.B 2010
Public Class Form1 Dim DATO1 As Double Dim DATO2 As Double Dim RESULTADO As Double Dim OPERACION As Double Dim BOT As Double Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click TextBox1.Text = TextBox1.Text & "1" End Sub Private Sub Button16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button16.Click TextBox1.Clear() Button11.Enabled = True End Sub Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click TextBox1.Text = TextBox1.Text & "0" End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Text = TextBox1.Text & "2" End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click TextBox1.Text = TextBox1.Text & "3" End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click TextBox1.Text = TextBox1.Text & "4" End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click TextBox1.Text = TextBox1.Text & "5" End Sub Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click TextBox1.Text = TextBox1.Text & "6" End Sub Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click TextBox1.Text = TextBox1.Text & "7" End Sub Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
Chvez Eduardo
TextBox1.Text = TextBox1.Text & "8" End Sub Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click TextBox1.Text = TextBox1.Text & "9" End Sub Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click TextBox1.Text = TextBox1.Text & "." BOT = 1 If BOT = 1 Then Button11.Enabled = False End If End Sub Private Sub Button15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button15.Click OPERACION = 1 DATO1 = Val(TextBox1.Text) TextBox1.Clear() Button11.Enabled = True End Sub Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click DATO2 = Val(TextBox1.Text) Button11.Enabled = True If OPERACION = 1 Then RESULTADO = DATO1 + DATO2 TextBox1.Text = RESULTADO Else If OPERACION = 2 Then RESULTADO = DATO1 - DATO2 TextBox1.Text = RESULTADO Else If OPERACION = 3 Then RESULTADO = DATO1 / DATO2 TextBox1.Text = RESULTADO Else If OPERACION = 4 Then RESULTADO = DATO1 * DATO2 TextBox1.Text = RESULTADO End If End If End If End If End Sub Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button14.Click OPERACION = 2 DATO1 = Val(TextBox1.Text) TextBox1.Clear() Button11.Enabled = True End Sub
Chvez Eduardo
Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button13.Click OPERACION = 3 DATO1 = Val(TextBox1.Text) TextBox1.Clear() Button11.Enabled = True End Sub Private Sub Button17_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button17.Click OPERACION = 4 DATO1 = Val(TextBox1.Text) TextBox1.Clear() Button11.Enabled = True End Sub End Class