protected override void OnKeyDown(KeyEventArgs args) { if (SelectedNode != null) { switch (args.KeyData) { case Keys.Delete: SelectedNode.Delete(); break; case Keys.X | Keys.Control: SelectedNode.CutToClipboard(); break; case Keys.C | Keys.Control: SelectedNode.CopyToClipboard(); break; case Keys.V | Keys.Control: SelectedNode.PasteFromClipboard(); break; case Keys.F2: SelectedNode.Rename(); break; default: base.OnKeyDown(args); return; } args.Handled = true; } else { base.OnKeyDown(args); } }
private void btnDelete_Click(object sender, System.EventArgs e) { Cursor.Current = Cursors.WaitCursor; if (SelectedNode != null) { SelectedNode.Delete(); } Cursor.Current = Cursors.Default; }