Skip to content

Accessing an arraylist from another form

bod

Asked Mar 6, 2006, 8:02 AM EST2 answers
Share
LinkedInX
I'm enjoying C#, but every now and then I come up against a brick wall. My problem is that I have a class with an arraylist that is populatd from a text file on my HD. On a form I have a listbox that needs to be populated with items from the arraylist, but I am unsure as how to go about accessing the arraylist from another form. Any help woud be great. Thanks in advance

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • 0

    Write a Public Property to expose the ArrayList from the second form and Access it from the first form.

    0
  • 0
    I didn't know you could do it that way. I have tried it and it works a great. I'ts very easy to setup as well. Thanks very much Binu Subi
    0