jueves, 29 de marzo de 2012

Private Sub cmdsuma_Click()
lbloperacion.Caption = "+"

End Sub

Private Sub cmdresta_Click()
lbloperacion.Caption = "-"

End Sub

Private Sub cmdmultiplicacion_Click()
lbloperacion.Caption = "*"

End Sub

Private Sub cmddivision_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

No hay comentarios:

Publicar un comentario