how to minimize window to maximize window using shortcut key in window application using c# ?
views:
209answers:
2
+1
A:
Looking at your accept rate, I will give you the steps:
- Add a KeyDown event handler on to the form you want minimized/maximized.
- Add code to check for the key combination you want
- Use
Form.WindowState
to set the state you require.
As a sidenote, please start accepting answers. You can do it by clicking the "tick" next to an answer that helped you solve your problem.
Kyle Rozendo
2010-05-03 09:01:18
its work when u can see form but when minimized then what happend??i wont have sictuation that minimize to maximized window form?
HITESH
2010-05-03 09:12:56
then you must register a Globale Windows HotKey. See here:http://dotnet-snippets.de/dns/globale-hotkeys-tastenkombinationen-SID356.aspx
Werewolve
2010-05-03 09:15:11
i m tell u that when i have minimized application then how to maximized application...?
HITESH
2010-05-03 10:06:00
plz tell me....???
HITESH
2010-05-03 10:06:23
+2
A:
Set Form Propertie "KeyPreview" = true.
Then use this code:
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.B)
{
WindowState = FormWindowState.Minimized;
}
}
Werewolve
2010-05-03 09:08:31