0

Hello,
My vb.Net code interacts with a design software and extracts a list of strings into an array.
I want to use that array to populate a list box on a form. Every search I try always retursn "How to send array from one form to another" I only have the one form. I know this is a newbie question, but I can't get it to populate. Can anyone help me?
Do I put everything in the form_load, or define the variables in the module? I cant seem to pass the variable from the module to the form listbox.
Thanks,
Mark

3
Contributors
2
Replies
14
Views
1 Year
Discussion Span
Last Post by tinstaafl
0

Loop through your array and for each item and call
ListBox.Items.Add()

You can call that in your Load event as you want the list populated when the form appears.

0

Alternatively you could assign the array as the DataSource for the ListBox:

    Dim strings() As String = {"B", "C"}
    ListBox1.DataSource = strings
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.