Use some sort of flag when saving, something that would never be in either listbox. For example:
vb Code:
'Save routine Dim sw As New IO.StreamWriter(filename) Dim i As Integer = 0 While i < Me.ListBox1.Items.Count sw.WriteLine(CStr(Me.ListBox1.Items(i))) i+=1 End While i = 0 sw.WriteLine("[SEPARATORSTRING]") While i < Me.ListBox2.Items.Count sw.WriteLine(CStr(Me.ListBox2.Items(i))) i+=1 End While sw.Close()
And do the opposite to save. Ignore that one line and switch listboxes after it.




Reply With Quote