Ejercicio 1: Form1 Object Eventargs
Ejercicio 1: Form1 Object Eventargs
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Label1.Text = "hola que haces" End Sub End Class
Ejercicio 2
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ListBox1.Items.Add(TextBox1.Text) TextBox1.Text = "" TextBox1.Focus() End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Try ListBox1.Items.Remove(ListBox1.SelectedItem) TextBox1.Focus() Catch ex As Exception End Try End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click ListBox1.Items.Clear() TextBox1.Focus() 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
Ejercicio 3
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.ListBox1.Items.Add(Me.TextBox1.Text) Me.ListBox2.Items.Add(Me.TextBox2.Text) Me.ListBox3.Items.Add(Me.TextBox3.Text) Me.ListBox4.Items.Add(IIf(Me.CheckBox1.Checked, "CASADO", "SOLTERO")) Me.TextBox4.Text = Me.ListBox1.Items.Count TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = ""
TextBox1.Focus() End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim I As Integer = Me.ListBox1.SelectedIndex Me.ListBox1.Items.RemoveAt(I) Me.ListBox2.Items.RemoveAt(I) Me.ListBox3.Items.RemoveAt(I) Me.ListBox4.Items.RemoveAt(I) Me.TextBox4.Text = Me.ListBox1.Items.Count 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
Ejercicio 4
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If RadioButton1.Checked = True Then Label1.Text = "Enrique Pea Nieto, Presidente Electo de Mxico, de seguro le vas al PRI" If RadioButton2.Checked = True Then Label1.Text = "Buen aos para la tierra" If RadioButton3.Checked = True Then Label1.Text = "Esperemos que nos valla bien" End Sub End Class
Ejercicio 5
Public Class Form1 Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As EventArgs) Handles Timer1.Tick ProgressBar1.Increment(10) Label2.Text = ProgressBar1.Value & " %" If ProgressBar1.Value = 100 Then Timer1.Stop() MsgBox("instalacion completa") End If End Sub Private Sub Button2_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Label1.Text = "Intalando..." Timer1.Start() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Label1.Text = "Instalacion"