views:

209

answers:

2

how to minimize window to maximize window using shortcut key in window application using c# ?

+1  A: 

Looking at your accept rate, I will give you the steps:

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
its work when u can see form but when minimized then what happend??i wont have sictuation that minimize to maximized window form?
HITESH
then you must register a Globale Windows HotKey. See here:http://dotnet-snippets.de/dns/globale-hotkeys-tastenkombinationen-SID356.aspx
Werewolve
i m tell u that when i have minimized application then how to maximized application...?
HITESH
plz tell me....???
HITESH
+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
its work when u can see form but when minimized then what happend??i wont have sictuation that minimize to maximized window form?
HITESH
see my comment in the other answer
Werewolve
ITS NOT WORKING....werewole
HITESH