PROGRAMACIÓN






Public Class Form1
    Dim bandera As String = ""
    Dim numero As Integer = "0"


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 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
        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 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 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 Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        bandera = ""

End Sub

Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
        bandera = "mov"
        numero = Val(TextBox1.Text)
        TextBox1.Text = ""
End Sub

Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button14.Click

If bandera = "mov" Then
            TextBox1.Text = numero Mod Val(TextBox1.Text)
   End If
If bandera = "div" Then
            TextBox1.Text = numero \ Val(TextBox1.Text)
   End If

If bandera = "suma" Then
            TextBox1.Text = numero + Val(TextBox1.Text)
   End If
If bandera = "resta" Then
            TextBox1.Text = numero - Val(TextBox1.Text)
    End If

If bandera = "multi" Then
            TextBox1.Text = numero * Val(TextBox1.Text)
    End If
       
If bandera = "divi" Then
            TextBox1.Text = numero / Val(TextBox1.Text)
   End If

        bandera = "  "

End Sub

Private Sub Button19_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button19.Click

End

End Sub

Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
        bandera = "DIV"
        numero = Val(TextBox1.Text)
        TextBox1.Text = ""
End Sub

Private Sub Button18_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles suma.Click
        bandera = "suma"
        numero = Val(TextBox1.Text)
        TextBox1.Text = "  "
End Sub

Private Sub resta_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles resta.Click
        bandera = "resta"
        numero = Val(TextBox1.Text)
        TextBox1.Text = "  "

End Sub

Private Sub multi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles multi.Click
        bandera = "multi"
        numero = Val(TextBox1.Text)
        TextBox1.Text = "  "

End Sub

Private Sub divi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles divi.Click
        bandera = "divi"
        numero = Val(TextBox1.Text)
        TextBox1.Text = "  "

End Sub

Private Sub Button15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button15.Click
        TextBox1.Text = TextBox1.Text & 0
End Sub

Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click
        TextBox1.Text = ""

    End Sub
End Class




No hay comentarios:

Publicar un comentario