Reputation: 337
Had a scout around, but can't find anything that works.
I have a list of an undetermined size, and I'm trying to display it in a list box List<String> urls
Items are dynamically added to the list by doing urls.Items.Add(string)
I've tried doing lstURLS.Items.Add(urls)
, and it returns Collections
in the list box.
I've also tried lsturls.Datasource = urls
but it doesn't recognise that as being valid code.
Is there an easy method of doing this?
Upvotes: 0
Views: 49
Reputation: 616
You'll need a for each loop:
for each (string s in urls) {lstUrls.Items.Add(s);}
I think this is what you're looking for?
Upvotes: 1