private void menuAddKeyValue_Click(object sender, EventArgs e) { EditItemForm form = new EditItemForm(true); form.ShowDialog(); if (form.DialogResult == DialogResult.OK) { listView1.Items.Add(form.getKey()).SubItems.Add(form.getValue()); updateSelectedIndex(); } }
// ADD private void menuAddHeader_Click(object sender, EventArgs e) { EditItemForm form = new EditItemForm(false); form.ShowDialog(); if (form.DialogResult == DialogResult.OK) { listView1.Items.Add(form.getHeader()); updateSelectedIndex(); } }
private void listView1_MouseDoubleClick(object sender, MouseEventArgs e) { EditItemForm eif; string key = "", value = ""; key = listView1.Items[this.selectedIndex].Text; value = listView1.Items[this.selectedIndex].SubItems[1].Text; eif = new EditItemForm(key, value); eif.ShowDialog(); if (eif.DialogResult == DialogResult.OK) { editListAndManager(this.selectedIndex, null, eif.getKey(), eif.getValue()); } else if (eif.DialogResult == DialogResult.Abort) { deleteFromListAndManager(this.selectedIndex, null, key); } }