Display array in list box VB 2008
15 pts.
0
Q:
Display array in list box VB 2008
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: Oct 18 2009  2:33 PM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
29795 pts.
0
A:
 RATE THIS ANSWER
+1
Click to Vote:
  •   1
  •  0
  • AddThis Social Bookmark Button
Try something like this:

        For i = 0 To 11
lstMonths.Items.Add(mstrMonths(i))
Next
Last Answered: Oct 19 2009  3:01 PM GMT by Carlosdl   29795 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Vitaming   15 pts.  |   Oct 19 2009  3:25PM GMT

it works! Thank you so much, Carlosdl!

 
0