My application is suppose to save the information that I put in the application that is in a listbox in form2. All the information is in form1, but I got it to save it in the listbox in form2 and I can see it when I load up the form2. Im suppose to make 10 different list for it, (it says it should be in arrays, but I dont know how to do it) and I should be able to save them everytime I put a new one in, but when I put a new list in the listbox and close the application and then reopen it, its erased, how do I save it and keep it in the lstbox so it doesnt get erased?
rookanga 0 Junior Poster in Training
Recommended Answers
Jump to PostSee if this helps.
Public Class Form1 Private myListBoxItemsFile As String = "C:\myListBoxItemsFile.txt" '// your file. '// Save to File from ListBox. Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing Dim myCoolWriter As New IO.StreamWriter(myListBoxItemsFile) For Each coolItem In ListBox1.Items '// loop thru …
Jump to PostVery confusing to understand.
Try my provided code in a new project with just one ListBox.
You can add a Button and a TextBox to that Form, and have in Button1.Click...Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ListBox1.Items.Add(TextBox1.Text) '// add …
Jump to PostYou keep saying that you need Form2's ListBox to save and load the items in it, but have you tried adding
Form2.
infront of the ListBox1 of my first post to this thread?For Each coolItem In Form2.ListBox1.Items '// loop thru all items in ListBox.
for saving, and for loading …
Jump to PostSee my reply to this thread. It may help you. Just follow the link below...
http://www.daniweb.com/software-development/vbnet/threads/360042/1538176#post1538176
All 13 Replies
codeorder 197 Nearly a Posting Virtuoso
rookanga 0 Junior Poster in Training
codeorder 197 Nearly a Posting Virtuoso
rookanga 0 Junior Poster in Training

Unhnd_Exception
rookanga 0 Junior Poster in Training
rookanga 0 Junior Poster in Training

Unhnd_Exception
rookanga 0 Junior Poster in Training
codeorder 197 Nearly a Posting Virtuoso
rookanga 0 Junior Poster in Training

Unhnd_Exception
P.manidas 39 Posting Whiz in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.