0

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?

1 Answer 1

1

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?

Sign up to request clarification or add additional context in comments.

1 Comment

@JordanMoffat to add the list at once w/o a foreach, use AddRange(urls)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.