Practica: Uso del control Checkbox en un programa en visual basic .

Net que calcula las operaciones aritméticas básicas

Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim a, b, r As Integer a = Convert.ToInt32(TextBox1.Text) b = Convert.ToInt32(TextBox2.Text) If CheckBox1.Checked = True Then r = a + b TextBox3.Text = Convert.ToInt32(r) End If If CheckBox2.Checked = True Then r = a - b TextBox4.Text = Convert.ToInt32(r) End If If CheckBox3.Checked = True Then r = a * b TextBox5.Text = Convert.ToInt32(r) End If If CheckBox4.Checked = True Then r = a / b TextBox6.Text = Convert.ToInt32(r) End If End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Clear() TextBox2.Clear() TextBox3.Clear() TextBox4.Clear() TextBox5.Clear() TextBox6.Clear() CheckBox1.Checked = False CheckBox2.Checked = False CheckBox3.Checked = False CheckBox4.Checked = False End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Me.Close() End Sub End Class

Sign up to vote on this title
UsefulNot useful