M
Mr. Bean
Hello,
I'm making a small app that loads users from an xml file. After loading
the data, new instances of a custom users class are initalized and at
the same time a listbox items are initialized with the users. My
question is when the listbox is changed how could I update a property
or know that Item in the list box, which instatnce it references.
//code to load users into usersDS
........
users[] theUsers = new users[anything.Count];
int counter = 0;
foreach(datarow user in userDS){
theUsers[counter] = new user(proper1, prop2);
listbox1.items.add(theUsers[counter].toString());
counter++;
}
listbox1_OEvent(){
//which users instance I'm I?
}
How do I Know which user instancce does the selected item represents?
I'm making a small app that loads users from an xml file. After loading
the data, new instances of a custom users class are initalized and at
the same time a listbox items are initialized with the users. My
question is when the listbox is changed how could I update a property
or know that Item in the list box, which instatnce it references.
//code to load users into usersDS
........
users[] theUsers = new users[anything.Count];
int counter = 0;
foreach(datarow user in userDS){
theUsers[counter] = new user(proper1, prop2);
listbox1.items.add(theUsers[counter].toString());
counter++;
}
listbox1_OEvent(){
//which users instance I'm I?
}
How do I Know which user instancce does the selected item represents?