joe_pool_is
Contributor
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:
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?
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:
Code:
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));
}
}
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?