Home
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
 
 
Old Pages
 
Old Index
Site Map
What's New
 
Books
How To
Tips & Tricks
Tutorials
Stories
Performance
Essays
Links
Q & A
New in VB6
Free Stuff
Pictures
 
 
 
 
 
 
 
TitleLoad data from a text file into ListBoxes
KeywordsListBox, text file, INI file
CategoriesControls, Files & Directories
 
By Rob Crombie.

This example loads a file of this form into a series of ListBoxes:

[ANIMALS]
dog
cat
rabbit
snake
[FRUITS]
apple
orange
mango
pineapple
[BUILDINGS]
shed
garage
house
mansion
[VEHICLES]
bike
motor bike
car
truck

The program loads the file and uses Split to separate the sections. It then uses Split again to separate the lines in each section and adds the lines to different ListBoxes.

See also Copy the lines in a file into a ListBox.

Also note that XML files make a natural way to store this kind of information. For information on using XML in VB .NET, see the book Visual Basic .NET and XML. For information on using XML with VB 6, see the article Getting Started with VB 6 and XML.

 
 
Copyright © 1997-2001 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated