Private Sub save_Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim i As Integer
w = New IO.StreamWriter("e:\test.txt")
For i = 0 To ListBox1.Items.Count - 1
w.WriteLine(ListBox1.Items.Item(i))
Next
w.Close()
End Sub
this code will save all items in listbox
but i want
when u click an item(selecteditem) then u click save button its only save that item,
and when u want to save another item then it save the two item in the same txt fie
etc : in listbox1 it have items "s1" , "s2" "s3"
when u select s1 then u click save it
so the txt file will have items s1 only
and when u select s2 and click the save button then in txt file u have 2 items
s1
s2
and so on