private void NesPPU_KeyDown(object sender, KeyEventArgs e) { if (ModifierKeys.HasFlag(Keys.Control) && e.KeyCode == Keys.C) { // find the control under the mouse var m = Cursor.Position; Control top = this; Control found; do { found = top.GetChildAtPoint(top.PointToClient(m)); top = found; }while (found != null && found.HasChildren); if (found != null) { var meth = found.GetType().GetMethod("ScreenshotToClipboard", Type.EmptyTypes); if (meth != null) { meth.Invoke(found, null); } else if (found is PictureBox) { Clipboard.SetImage((found as PictureBox).Image); } else { return; } toolStripStatusLabel1.Text = found.Text + " copied to clipboard."; Messagetimer.Stop(); Messagetimer.Start(); } } }
private void MessageTimer_Tick(object sender, EventArgs e) { Messagetimer.Stop(); toolStripStatusLabel1.Text = "Use CTRL+C to copy the pane under the mouse to the clipboard."; }