Hi all:
I have a base class SurveyObject, and I derive two new classes
Question and Instruction.
I then create an
ArrayList<SurveyObject> soList = new ArrayList();
and add Instructions and Questions to the ArrayList.
Instruction i1 = new Instruction();
soList.Add(i1);
Question q1 = new Question();
soList.Add(q1);
Question q2 = new Question();
soList.Add(q2);
I have a form1 to handle Instructions and a form2 to handle Questions.
What is most elegant way to select the approrpriate form to display
the appropriate SurveyObject when I loop through the ArrayList of
SurveyObjects?
Thanks,
Stephen
Simon Hart [MVP] - 27 Mar 2008 22:36 GMT
The cleaner solution is to have separate collections for each form. Note: You
can't add multiple types to a generic arraylist, you can with a non-generic
arraylist though.

Signature
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com
> Hi all:
>
[quoted text clipped - 19 lines]
> Thanks,
> Stephen