Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 278
  • Last Modified:

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
0
vcharles
Asked:
vcharles
  • 3
1 Solution
 
Mike TomlinsonMiddle 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

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now