Delete selected rowes in a listview from .txt file
-
if i want to delete the selected row in a list view i use: if (listView1.SelectedItems.Count > 0) { if (MessageBox.Show("Vill du verkligen ta bort denna?", "Mina jobb", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { for (int i = listView1.SelectedItems.Count - 1; i >= 0; i--) listView1.Items.Remove(listView1.SelectedItems); } } But if i want to delete this selected row from a .txt file how do i do that..??? it´s four subitems and the .txt file look like this # blah blablah blabl blaaa //thanks;);P:^):(:sigh::doh:
-
if i want to delete the selected row in a list view i use: if (listView1.SelectedItems.Count > 0) { if (MessageBox.Show("Vill du verkligen ta bort denna?", "Mina jobb", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { for (int i = listView1.SelectedItems.Count - 1; i >= 0; i--) listView1.Items.Remove(listView1.SelectedItems); } } But if i want to delete this selected row from a .txt file how do i do that..??? it´s four subitems and the .txt file look like this # blah blablah blabl blaaa //thanks;);P:^):(:sigh::doh:
andredani wrote:
But if i want to delete this selected row from a .txt file how do i do that..???
It's your course assignment not ours. I'm pretty sure the point of the assignment is for "you" to figure that out rather than for you to go out on the internet and ask people how to do it. I mean really, you are in school now, if this is not the time when you are going to start thinking for yourself and developing problem solving skills, when are you?