Alex Rivera | Logout

C#: easiest way to populate a ListBox from a List

Asked 2010-12-01T04:50:36.840
47

If I have a list of strings, eg:

List<string> MyList = new List<string>();
MyList.Add("HELLO");
MyList.Add("WORLD");

Is there an easy way to populate a ListBox using the contents of MyList?

Edit
Report

1 Answer

12

Is this what you are looking for:

myListBox.DataSource = MyList;
answered 2010-12-01T04:57:27.027

Your Answer