0

hi,
im new in vb.net
i want to delete an item on a listview,
this is my code

     If ListView1.SelectedItems.Count > 0 AndAlso MessageBox.Show("Do you want to delete this item?", "Confirm", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then 'make sure there is a selected item to delete
            ListView1.SelectedItems(0).Remove()
        End If

now my problem is i want to delete that item on the text file line

( using streamreader and streamwriter)
can someone help??

2
Contributors
1
Reply
2
Views
4 Years
Discussion Span
Last Post by lolafuertes
0

Wich is the structure of the text file?
Are you selecting by index (in the same order that the original text) or the values in the listview are sorted in a distinct way?

Are the items in the listview having subitems? In this case, are relevat to the text file contents?

Did you need to delete the content of the text file or you can create a new temp file from remaining content in the listview, and then rename the old to .old then rename new to the right name??

Please, let us know.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.