static void hkmgr_KeyUp(object sender, KeyboardEventArgs e) { if (e.HasModifierKey(ModifierKeys.Control)) { if (e.KeyCode == KeyboardKey.X || e.KeyCode == KeyboardKey.C) { string data = Clipboard.GetText(); if (String.IsNullOrEmpty(data)) { return; } ClipboardCommentDialog dlg = new ClipboardCommentDialog(); dlg.Location = CenterIn(System.Windows.Forms.Cursor.Position, dlg.ClientRectangle); if (dlg.ShowDialog() == DialogResult.OK) { list.Add(data); Clipboard.Clear(); } } } if (e.KeyCode == KeyboardKey.Escape) { popup.Hide(); } }
static void hkmgr_KeyDown(object sender, KeyboardEventArgs e) { if (e.HasModifierKey(ModifierKeys.Control) && e.KeyCode == KeyboardKey.V) { ShowPopup(); } }