0% found this document useful (0 votes)
22 views

Private Sub As Object As Handles Mybase

The document contains code for initializing and populating lists and text boxes in a form application. It includes code to: 1) Populate list boxes and combo boxes with items on form load. 2) Add numbers from 1 to 50 to a list box when a button is clicked. 3) Add user inputted items to a list box using an input box when another button is clicked. 4) Display the count of items in a list box when a button is clicked. 5) Display the selected item from a list box in a text box when the list box selection changes. 6) Set an initial value for a text box and populate additional lists on each loop that gets input
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Private Sub As Object As Handles Mybase

The document contains code for initializing and populating lists and text boxes in a form application. It includes code to: 1) Populate list boxes and combo boxes with items on form load. 2) Add numbers from 1 to 50 to a list box when a button is clicked. 3) Add user inputted items to a list box using an input box when another button is clicked. 4) Display the count of items in a list box when a button is clicked. 5) Display the selected item from a list box in a text box when the list box selection changes. 6) Set an initial value for a text box and populate additional lists on each loop that gets input
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.

Load
ListBox1.Items.Add("fideos de chia")
ListBox1.Items.Add("arroz integral")
ListBox1.Items.Add("harina de trigo")
ComboBox1.Items.Add("aceite")
ComboBox1.Items.Add("agua")
ComboBox1.Items.Add("colorante")
ComboBox1.Items.Add("preservante")
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim x As Integer
For x = 1 To 50
ListBox1.Items.Add(x)
Next
End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles


Button2.Click
Dim x As Integer
x = 1
While x <= 50
ListBox2.Items.Add(x)
x = x + 1
End While
End Sub

Private Sub Button3_Click(sender As Object, e As EventArgs) Handles


Button3.Click
Dim x, insumos As String
x = 1
While x <= 10
insumos = InputBox("Ingrese insumo")
ListBox3.Items.Add(insumos)
x = x + 1
End While
End Sub

Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click


TextBox1.Text = ListBox4.Items.Count

End Sub
Private Sub ListBox4_SelectedIndexChanged(sender As Object, e As EventArgs)
Handles ListBox4.SelectedIndexChanged
TextBox2.Text = ListBox4.SelectedItem
End Sub

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load


Dim monto As Integer
monto = 20
TextBox1.Text = monto

End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles


Button1.Click
Dim trabajador As String
Dim horas As Integer
Dim pagar As Integer
For x = 1 To 5
trabajador = InputBox("Ingrese trabajador")
ListBox1.Items.Add(trabajador)
horas = InputBox("Ingrese hora")
ListBox2.Items.Add(horas)
pagar = (horas * TextBox1.Text)
ListBox3.Items.Add(pagar)
Next
End Sub

You might also like