0% found this document useful (0 votes)
21 views2 pages

Ingrese Valor de A

The document contains code for a form with buttons that allow a user to: 1) Input values for variables A and B which are added to listboxes. 2) Remove selected items from the listboxes. 3) Multiply the values of A and B in each listbox and add the results to a third listbox. 4) Clear all textboxes and listboxes.

Uploaded by

jose isaac
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)
21 views2 pages

Ingrese Valor de A

The document contains code for a form with buttons that allow a user to: 1) Input values for variables A and B which are added to listboxes. 2) Remove selected items from the listboxes. 3) Multiply the values of A and B in each listbox and add the results to a third listbox. 4) Clear all textboxes and listboxes.

Uploaded by

jose isaac
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/ 2

Public Class Form1

Dim A As Single
Dim B As Single
Dim C As Single
Dim n As Integer
Dim ndato As Integer
Dim i As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
ndato = Val(TextBox1.Text)
For i As Integer = 0 To ndato - 1
A = InputBox("ingrese valor de A", i)
ListBox1.Items.Add(A)
TextBox2.Text = ListBox1.Items.Count

B = InputBox("ingrese valor de B", i)


ListBox2.Items.Add(B)
TextBox3.Text = ListBox2.Items.Count

Next i
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
ListBox1.Items.Remove(ListBox1.SelectedItems())
For i As Integer = 0 To ListBox1.Items.Count() - 1
A = 0
A = Val(ListBox1.Items.Item(i))
Next i
ListBox2.Items.Remove(ListBox2.SelectedItems())
For i As Integer = 0 To ListBox2.Items.Count() - 1
B = 0
B = Val(ListBox2.Items.Item(i))
Next i
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button3.Click
A = ListBox1.Items.Count
For i As Integer = 0 To A - 1
A = Val(ListBox1.Items.Item(i))
B = Val(ListBox2.Items.Item(i))
C = A * B
ListBox3.Items.Add(C)
TextBox4.Text = ListBox3.Items.Count
Next i
End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button5.Click
End
End Sub

Private Sub Button4_Click_1(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button4.Click
ListBox1.Items.Clear()
ListBox2.Items.Clear()
ListBox3.Items.Clear()
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
End Sub
End Class

You might also like