Help with adding data in listbox using VB.NET

vcharles
vcharles used Ask the Experts™
on
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
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Retired
Distinguished Expert 2017
Commented:
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

Author

Commented:
Thank You.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial