Solved

Help with displying string variable in Combobox using VB.BET

Posted on 2013-10-26
4
267 Views
Last Modified: 2013-10-27
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
Comment
Question by:vcharles
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 39603491
Use Split() and AddRange() like this:
Dim S As String = "BEL,CAN,FRA,USA"
ComboBox1.Items.AddRange(S.Split(","))

Open in new window

0
 

Author Comment

by:vcharles
ID: 39603492
Thanks, Is it possible to view the same data in a Grid?
0
 

Author Comment

by:vcharles
ID: 39603493
I meant the DataGrid that comes with VS2010
0
 

Author Closing Comment

by:vcharles
ID: 39603762
Thank You.
0

Featured Post

The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question