Click here to Skip to main content
15,891,895 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I'm using vb.net form.

I have 8 listboxes (listbox1 , listbox2,listbox3..) each one contains many items and another empty listbox (listbox10). I'm trying to add first listboxes items into the listbox10

ex: listbox1 first items is "A" , listbox2 first items is "B" , listbox3 first items is "C"...etc . Now listbox10 first item must be "Abc...";

The problem is i want to add text ( string or number) between each listbox

ex: listbox1 first items is "A" , listbox2 first items is "B" , listbox3 first items is "C"...etc . Now I want listbox10 first item to be "The letters A is before B and now C"

here is my code

Dim controls = New List(Of ListBox)() From _
{ListBox1, ListBox2, ListBox3, ListBox4, ListBox5, ListBox6, ListBox7, ListBox8}
    Dim minCount = Controls.Min(Function(x) x.Items.Count)
    For x = 1 To minCount - 1
        ListBox10.Items.Add(String.Join(" ", controls.Select
        (Function(lb) lb.Items(x).ToString)))
    Next

End Sub


Where i must to add my string/text?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900