예제 #1
0
 void lstText_KeyUp(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Delete)
         InvokeItemDeleted(this, new ColumnItemEventArgs((int)lstText.SelectedValue, Title, null));
     else if (e.KeyCode == Keys.F2 && lstText.SelectedIndex >= 0)
     {
         RenameForm renameForm = new RenameForm(lstText.Text);
         if (renameForm.ShowDialog() == DialogResult.OK)
         {
             CurrentEntry = renameForm.UserEntry;
             InvokeItemModified(this, new ColumnItemEventArgs((int)lstText.SelectedValue, Title, renameForm.UserEntry));
         }
     }
 }
예제 #2
0
 void modifyToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (lstText.SelectedIndex >= 0)
     {
         RenameForm renameForm = new RenameForm(lstText.Text);
         if (renameForm.ShowDialog() == DialogResult.OK)
         {
             CurrentEntry = renameForm.UserEntry;
             InvokeItemModified(this, new ColumnItemEventArgs((int)lstText.SelectedValue, Title, renameForm.UserEntry));
         }
     }
 }