Like this:
public names(string strnickName, string strrealName)
Put the following code in your Load Event.
ArrayList names1 = new ArrayList();
names1.Add(new names("Mary", "Sis"));
names1.Add(new names("Joe", "Bubba"));
names1.Add(new names("Lynn", "Mom"));
names1.Add(new names("Fred", "Dad"));
names1.Add(new names("Sandy", "dog"));
listBox1.DataSource = names1;
listBox1.DisplayMember = "nickName1";
As far as the rest of the code you are asking about. You are going to have to explain what you are trying to do. Currently, you are trying to assign values to the ListBox and you can't do this when it is tied to a data source.

New Topic/Question
Reply





MultiQuote




|