コード例 #1
0
        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();
            }
        }
コード例 #2
0
        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);
            }
        }