我想从主窗体中删除listview项 在我以另一种形式点击btn之后 我该怎么办?
主要表格
private void DeleteSelectedProductRclick_Click(object sender, EventArgs e)
{
int id = int.Parse(ProductListView.SelectedItems[0].SubItems[0].Text);
string prodname = ProductListView.SelectedItems[0].SubItems[1].Text;
string prodid = ProductListView.SelectedItems[0].SubItems[2].Text;
string cutsentence = null;
for (int i = 7; i >= 1; i--)
{
cutsentence = FirstWords(prodname, i);
if (cutsentence.Length <= 45)
{
cutsentence = cutsentence + " ...";
i = 0;
}
}
DeleteProductForm mg = new DeleteProductForm(id, cutsentence, prodid);
mg.Show();
}
秒表
private void Yesbtn_Click(object sender, EventArgs e)
{
EbaySellBL.EbayProduct.DeleteProduct(this.ID);
this.Close();
//ProductListView.SelectedItems[0].Remove();
}
答案 0 :(得分:1)