Hi, ive generated files from a text file to a checklist box. now i want to delete some of it, example i have anna on the first check box and when i check it and click on the delete command the name anna will be removed from the checklist box together with its name on the text file. help pls. thanks.
dc_24l
0
Newbie Poster
Recommended Answers
Jump to PostHi,
This is how to delete it from the CheckBoxList :
private void buttonDeleteItem_Click(object sender, EventArgs e) { for (int i = 0; i < this.checkedListBox1.CheckedItems.Count; i++ ) { this.checkedListBox1.Items.Remove(this.checkedListBox1.CheckedItems[i]); string modified = theStringFromWhereYouLoadTheTextBox.Replace(this.checkedListBox.CheckedItems[i].ToString(), string.Empty );//And then Create a new file with same name that the …
All 3 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.