i'm making a program for a friend that is a DJ where people can request songs to the DJ and so it sends the requested songs to him.
and so i have two listboxes, the first one being the list of songs and the second one being the already requested songs. we don't want people to double-request songs so i want the entry to get removed from the first list box as it gets added to the second one. that part works. just in case they close the application, i made it save the list to a txt file and when it opens, it shows the list of already requested songs. the problem is that it shows the songs in the list of requested songs, but when it reloads the form it also re-adds the songs to the list of songs (since it reads off a certain folder).
hopefully you understood that.
here is my code:
VB Code:
'Load what is already requested readrequested = New IO.StreamReader("RequestedList.txt") While (readrequested.Peek() > -1) ListBox2.Items.Add(readrequested.ReadLine) ListBox1.Items.Remove(readrequested.ReadLine) 'Tried doing this but still does not remove the items, probably because it has multiple lines. End While readrequested.Close()





Reply With Quote