我在 Google 中进行了一些搜索,但找不到有用的方法...请帮助...所以我有一个列表框来显示数据库中的数据,我的功能允许用户一次删除一个/多个数据,当然我想相应地刷新我的列表框。例如,我尝试 checkListBox1.Refresh(); 但没有用。请帮我。
private void button1_Click(object sender, EventArgs e)
{
string item_name = "";
foreach (object itemChecked in checkedListBox1.CheckedItems)
{
item_name = itemChecked.ToString();
removefromdatabse2(item_name); // a function that update the database
MessageBox.Show("successfully deleted");
// checkedListBox1.Refresh(); , which didn't work
}
}