Display array in list box VB 2008

15 pts.
Tags:
VB
VB 2008
Visual Basic 08
Hi all, How do I display a whole array in one list box? (I want it to be displayed in the form load event...is that possible?) 
For example I want to display these: ============================ 
 mstrMonths(0) = "January" 
 mstrMonths(1) = "February" 
 mstrMonths(2) = "March" 
 mstrMonths(3) = "April" 
============================ 
in a list box. I tried doing this:
======================================================== lstMonths.Text = mstrMonths(0) & vbNewLine & mstrMonths(1) & vbNewLine &  mstrMonths(2) vbNewLine & mstrMonths(3) ======================================================== and it didn't work.
Thanks for your help =)


Software/Hardware used:
Visual Basic Express 2008
ASKED: October 18, 2009  2:33 PM
UPDATED: October 19, 2009  3:25 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

Try something like this:

<pre> For i = 0 To 11
lstMonths.Items.Add(mstrMonths(i))
Next</pre>

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Vitaming
    it works! Thank you so much, Carlosdl!
    15 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following