Codigo de calculadora, por Bren y Joy
Private Sub borrador_Click()
visor.Caption = " "
End Sub
Private Sub cinco_Click()
visor.Caption = visor.Caption + "5"
End Sub
Private Sub cuatro_Click()
visor.Caption = visor.Caption + "4"
End Sub
Private Sub dividido_Click()
auxiliaruno.Caption = visor.Caption
auxiliardos.Caption = "/"
visor.Caption = " "
End Sub
Private Sub dos_Click()
visor.Caption = visor.Caption + "2"
End Sub
Private Sub igual_Click()
If auxiliardos.Caption = "+" Then
visor.Caption = Val(auxiliaruno.Caption) + Val(visor.Caption)
auxiliaruno.Caption = ""
auxiliardos.Caption = ""
End If
If auxiliardos.Caption = "-" Then
visor.Caption = Val(auxiliaruno.Caption) - Val(visor.Caption)
auxiliaruno.Caption = ""
auxiliardos.Caption = ""
End If
If auxiliardos.Caption = "/" Then
visor.Caption = Val(auxiliaruno.Caption) / Val(visor.Caption)
auxiliaruno.Caption = ""
auxiliardos.Caption = ""
End If
If auxiliardos.Caption = "*" Then
visor.Caption = Val(auxiliaruno.Caption) * Val(visor.Caption)
auxiliaruno.Caption = ""
auxiliardos.Caption = ""
End If
End Sub
Private Sub mas_Click()
auxiliaruno.Caption = visor.Caption
auxiliardos.Caption = "+"
visor.Caption = " "
End Sub
Private Sub menos_Click()
auxiliaruno.Caption = visor.Caption
auxiliardos.Caption = "-"
visor.Caption = " "
End Sub
Private Sub multiplicar_Click()
auxiliaruno.Caption = visor.Caption
auxiliardos.Caption = "*"
visor.Caption = " "
End Sub
Private Sub nueve_Click()
visor.Caption = visor.Caption + "9"
End Sub
Private Sub ocho_Click()
visor.Caption = visor.Caption + "8"
End Sub
Private Sub punto_Click()
visor.Caption = visor.Caption + "."
End Sub
Private Sub seis_Click()
visor.Caption = visor.Caption + "6"
End Sub
Private Sub siete_Click()
visor.Caption = visor.Caption + "7"
End Sub
Private Sub tres_Click()
visor.Caption = visor.Caption + "3"
End Sub
Private Sub uno_Click()
visor.Caption = visor.Caption + "1"
End Sub
Private Sub zero_Click()
visor.Caption = visor.Caption + "0"
End Sub
Private Sub borrador_Click()
visor.Caption = " "
End Sub
Private Sub cinco_Click()
visor.Caption = visor.Caption + "5"
End Sub
Private Sub cuatro_Click()
visor.Caption = visor.Caption + "4"
End Sub
Private Sub dividido_Click()
auxiliaruno.Caption = visor.Caption
auxiliardos.Caption = "/"
visor.Caption = " "
End Sub
Private Sub dos_Click()
visor.Caption = visor.Caption + "2"
End Sub
Private Sub igual_Click()
If auxiliardos.Caption = "+" Then
visor.Caption = Val(auxiliaruno.Caption) + Val(visor.Caption)
auxiliaruno.Caption = ""
auxiliardos.Caption = ""
End If
If auxiliardos.Caption = "-" Then
visor.Caption = Val(auxiliaruno.Caption) - Val(visor.Caption)
auxiliaruno.Caption = ""
auxiliardos.Caption = ""
End If
If auxiliardos.Caption = "/" Then
visor.Caption = Val(auxiliaruno.Caption) / Val(visor.Caption)
auxiliaruno.Caption = ""
auxiliardos.Caption = ""
End If
If auxiliardos.Caption = "*" Then
visor.Caption = Val(auxiliaruno.Caption) * Val(visor.Caption)
auxiliaruno.Caption = ""
auxiliardos.Caption = ""
End If
End Sub
Private Sub mas_Click()
auxiliaruno.Caption = visor.Caption
auxiliardos.Caption = "+"
visor.Caption = " "
End Sub
Private Sub menos_Click()
auxiliaruno.Caption = visor.Caption
auxiliardos.Caption = "-"
visor.Caption = " "
End Sub
Private Sub multiplicar_Click()
auxiliaruno.Caption = visor.Caption
auxiliardos.Caption = "*"
visor.Caption = " "
End Sub
Private Sub nueve_Click()
visor.Caption = visor.Caption + "9"
End Sub
Private Sub ocho_Click()
visor.Caption = visor.Caption + "8"
End Sub
Private Sub punto_Click()
visor.Caption = visor.Caption + "."
End Sub
Private Sub seis_Click()
visor.Caption = visor.Caption + "6"
End Sub
Private Sub siete_Click()
visor.Caption = visor.Caption + "7"
End Sub
Private Sub tres_Click()
visor.Caption = visor.Caption + "3"
End Sub
Private Sub uno_Click()
visor.Caption = visor.Caption + "1"
End Sub
Private Sub zero_Click()
visor.Caption = visor.Caption + "0"
End Sub
Captura de pantalla:
No comments:
Post a Comment