Public Class frmCalculadora
Dim num1, num2 As Double
Private Sub
BtnCalcular_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
BtnCalcular.Click
num1 = Me.TxtNum1.Text
num2 = Me.TxtNum2.Text
If Me.OpcSuma.Checked
= True Then
Me.TxtResp.Text = num1 + num2
End If
If Me.OpcResta.Checked
= True Then
Me.TxtResp.Text = num1 - num2
End If
If Me.OpcMultiplicacion.Checked
= True Then
Me.TxtResp.Text = num1 * num2
End If
If Me.OpcDivision.Checked
= True Then
Me.TxtResp.Text = num1 / num2
End If
End Sub
Private Sub
BtnSalir_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
BtnSalir.Click
End
End Sub
End Class
No hay comentarios:
Publicar un comentario