How can I add an item to a ListBox in C# and WinForms?

Viewed 180705

I'm having trouble figuring out how to add items to a ListBox in WinForms.

I have tried:

list.DisplayMember = "clan";
list.ValueMember = sifOsoba;

How can I add ValueMember to the list with an int value and some text for the DisplayMember?

list.Items.add(?)

Btw. I can't use ListBoxItem for any reasons.

9 Answers

If you just want to add a string to it, the simple answer is:

ListBox.Items.Add("some text");
Related