Listbox Question

  • Thread starter Thread starter scooge
  • Start date Start date
S

scooge

class Person {
int id;
string name;
string description
}

In the Array [] Persons i hold a collection of some Persons

In a Listbox i want to show the name

listbox.Items.AddRange(Persons);

now it's showing me "Persons" in the List, how can i select the Name for
the display?

I want my collection inside this listbox, so that i can use it for other
things. Handling events etc

thx
 
scooge said:
class Person {
int id;
string name;
string description
}

In the Array [] Persons i hold a collection of some Persons

In a Listbox i want to show the name

listbox.Items.AddRange(Persons);

now it's showing me "Persons" in the List, how can i select the Name for
the display?

Override 'ToString' in 'Person' and return the name.
 
Back
Top