Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving and Loading ALL items in a listbox... need help.

Status
Not open for further replies.

IcebLuE

Programmer
Joined
Jul 21, 2001
Messages
5
Location
US
Hey, I have been looking and posting everywhere!! But I was wondering if anyone has the code to Save and Load ALL items in a listbox? If you do, please reply back! Thanks!

v^v^ SilverIcE ^v^v
 
I use VB3... so it should be VB3 code, if anyone knows how to do it.

v^v^ SilverIcE ^v^v
 
I only have access to vb4 but this should help you get started in your own research..

SaveListInfo:

Dim ListWord AS String
If List1.ListCount >= 1 Then
For MyCycle = 0 To List1.ListCount - 1
ListWord = List1.List(MyCycle)
'save ListWord
Next
End If
"The world shrinks more and more with every new user online."
 
Hey... About your post, MiggyD, thanks for replying so fast! But I have a question about the given code. Do you know how to save all items in the listbox to a file? I have only been programming for like 2 months and I do it in my spare time, so I am not really experienced when I have to figure out things like this. LOL... If you could let me know about that, that'd be great! Thanks so much!

v^v^ SilverIcE ^v^v

 
To answer your question: Yes...the entire list can be saved to a file if you choose to.

So, how would you do it? Well, check out VB's help files for the OPEN, PRINT, WRITE, CLOSE, SAVESETTINGS, GETSETTINGS, and LISTBOX statements. It should all be there under examples.

I'll reiterate again, this is based on VB4 programming, but it should be very similar to VB3; AND hopefully gets you stared in your own acquisition of knowledge.

Sinc.
--MiggyD "The world shrinks more and more with every new user online."
 
Hey, I figured it out!
 
I'm glad you were able to figure it out.

Good luck with your learning.
--MiggyD It's better to have two heads to solve a problem from different angles than to have tunnel vision to a dead end.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top