joe_pool_is Posted August 14, 2009 Posted August 14, 2009 I've written a Print Screen routine that captures *all* of the information displayed by my project (2 or 3 forms), saves it to a defined image type in a folder that the operator selects, then displays the image in an external viewer. My operators, however, are still trying to use the "Print Screen" key and pasting their images on their own because they forget that my tool is there. So, I want to capture the "Print Screen" key. I've written these two routines and wired them to the MDI Form, but they never fire:void MdiForm_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.PrintScreen) { ScreenCapture(Environment.GetFolderPath(Environment.SpecialFolder.Desktop)); e.Handled = true; } } void MdiForm_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) { if (e.KeyCode == Keys.PrintScreen) { ScreenCapture(Environment.GetFolderPath(Environment.SpecialFolder.Desktop)); } }I'm guessing the problem is that other forms (and their controls) have focus, so the events are being sent to there instead of to my routines. How can I wire up my routine so that I can catch key presses *without* having to wire each and every control to these two events? Quote Avoid Sears Home Improvement
joe_pool_is Posted August 14, 2009 Author Posted August 14, 2009 I just set the MDI form's KeyPreview property to true. The event handlers for KeyDown and KeyPress now catch *regular* keys, but I still can't catch that Print Screen button! Quote Avoid Sears Home Improvement
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.