private void listView1_SelectedIndexChanged(object sender, EventArgs e) { if (listView1.SelectedItems.Count == 0) { return; } selected = listView1.SelectedItems[0].Tag as RectInfo; }
private void deleteToolStripMenuItem_Click(object sender, EventArgs e) { if (listView1.SelectedItems.Count == 0) { return; } var t = listView1.SelectedItems[0].Tag as RectInfo; currentItem.Infos.Remove(t); updateInfosList(); selected = null; }