jueves, 29 de marzo de 2012
CALCULADORA BASICA
Private Sub division_Click()
lbloperacion.Caption = "/"
End Sub
Private Sub multiplicacion_Click()
lbloperacion.Caption = "*"
End Sub
Private Sub resta_Click()
lbloperacion.Caption = "-"
End Sub
Private Sub suma_Click()
lbloperacion.Caption = "+"
End Sub
Private Sub cmdresultado_Click()
If lbloperacion.Caption = "+" Then
lblresultado.Caption = Val(txtval1.Text) + Val(txtval2.Text)
Else
If lbloperacion.Caption = "-" Then
lblresultado.Caption = Val(txtval1.Text) - Val(txtval2.Text)
Else
If lbloperacion.Caption = "*" Then
lblresultado.Caption = Val(txtval1.Text) * Val(txtval2.Text)
Else
If lbloperacion.Caption = "/" Then
lblresultado.Caption = Val(txtval1.Text) / Val(txtval2.Text)
End If
End If
End If
End If
End Sub
Suscribirse a:
Comentarios (Atom)
