You are on page 1of 1

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

Net que calcula las operaciones aritmticas

ublic 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 ComboBox1.Text r = a + b TextBox3.Text End If If ComboBox1.Text r = a - b TextBox3.Text End If If ComboBox1.Text r = a * b TextBox3.Text End If If ComboBox1.Text r = a / b TextBox3.Text End If End Sub = "suma" Then = Convert.ToInt32(r) = "resta" Then = Convert.ToInt32(r) = "multiplicacion" Then = Convert.ToInt32(r) = "division" Then = Convert.ToInt32(r)

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Clear() TextBox2.Clear() TextBox3.Clear() ComboBox1.Text = "" 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

You might also like