Solved

Help with adding data in listbox using VB.NET

Posted on 2016-09-24
2
38 Views
Last Modified: 2016-09-24
Hi,

How do you add list of data in a listbox by code using VB.NET, for example How do you add the following three rows:

NSN
NSC
FIF

Thanks,

Victor
0
Comment
Question by:vcharles
2 Comments
 
LVL 63

Accepted Solution

by:
Fernando Soto earned 500 total points
ID: 41814192
Hi Victor;

This is how it can be done.
'' Items to be added to the ListBox
Dim items As New List(Of String)() From {"NSN", "NSC", "FIF"}

ListBox1.DataSource = items

Open in new window

0
 

Author Closing Comment

by:vcharles
ID: 41814201
Thank You.
0

Featured Post

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

789 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