Help with displying string variable in Combobox using VB.BET

Hi,

If I  have a string variable S = BEL,CAN,FRA,USA

How do I display the values in a combobox as shown below? My string will vary, just using values in S as an example.

BEL
CAN
FRA
USA

Thanks,

Victor
vcharlesAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Mike TomlinsonConnect With a Mentor Middle School Assistant TeacherCommented:
Use Split() and AddRange() like this:
Dim S As String = "BEL,CAN,FRA,USA"
ComboBox1.Items.AddRange(S.Split(","))

Open in new window

0
 
vcharlesAuthor Commented:
Thanks, Is it possible to view the same data in a Grid?
0
 
vcharlesAuthor Commented:
I meant the DataGrid that comes with VS2010
0
 
vcharlesAuthor Commented:
Thank You.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.