I was wondering how do I use a hotkey on keyboard to hide and show the entire form in C# ?
I already tried something, but the form must be in focus.
Is there any way to do it without the focus, like if i was in other application?
Thanks.
`private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Q)
{
WindowState = FormWindowState.Minimized;
}
}
private void Form1_KeyUp(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Q)
{
WindowState = FormWindowState.Normal;
}
}`
I tried this but this just doesn't work at all.