I want to trigger an action when a specific hotkey is pressed?
For example:
if the Ctrl+W key is pressed.
then display a messagebox.
I have searched the forum and someone asked a similar question but didn't get a answer...
So is this possible? And how should i do it?
Hello World 0Posted Jan 22, 2011, 3:40 PM
But i did not find a way to use a mouse combination as a hotkey..
Does anyone knows if it that is possible?
Cause i only saw that you can use alt ctrl shift and win as modifier key's
Hello World 0Posted Jan 21, 2011, 5:46 PM
i'll have checked the links you posted. But i'm new to programming so i don't understand much of it..
But i did found this on the website:
http://www.c-sharpcorner.com/UploadFile/rafaelwo/1590/
And i hope i can modify that or figure out how that works..
Bye
Suthish NairPosted Jan 21, 2011, 2:24 PM
1 2 3
Hello World 0Posted Jan 21, 2011, 1:59 PM
and i want to use it to show and hide my form.
example:
when i press control+w
If the form is not hidden show it else hide the form
Roy SPosted Jan 21, 2011, 12:25 PM
private void Form1_KeyUp(object sender, KeyEventArgs e)
{
if (e.Modifiers == Keys.Control && e.KeyCode == Keys.W)
{
//do stuff
}
}
Btw: This will also work when a child control has the focus (so if the cursor is in a textbox, it will still work).