private void buttonDelete_Click(object sender, EventArgs e) { if (MessageBoxEx.Show("确定要删除这条数据吗?", "警告", SystemIcons.Warning) == System.Windows.Forms.DialogResult.OK) { pack.RemovePackData(selectId); refreshList(0); } }
private void toolStripMenuItemRemove2_Click(object sender, EventArgs e) { if (listViewVegas.SelectedItems.Count <= 0) { return; } int sel = listViewVegas.SelectedIndices[0] - 1; if (sel < 0) { sel = 0; } OldDataPack pack = OldDataPackBook.GetPack("cfg_map_plant"); foreach (ListViewItem lvm in listViewVegas.SelectedItems) { String[] data = lvm.Text.Split('.'); int pid = int.Parse(data[0]); pack.RemovePackData(pid); } this.installLivePlant(); foreach (ListViewItem lvm in listViewVegas.Items) { if (lvm.Index == sel) { lvm.Selected = true; lvm.EnsureVisible(); } } updateMap(); }