Try this code,
....
If ListBox1.SelectedIndex <> -1 Then
ListBox1.Items.RemoveAt(ListBox1.SelectedIndex)
System.IO.File.WriteAllLines("file.txt", ListBox1.Items.Cast(Of String)().ToArray())
End If
....
__avd
Posting Genius (adatapost)
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241