Is there a way to programmatically minimize a window

Viewed 126598

What I'm doing is I have a full-screen form, with no title bar, and consequently lacks the minimize/maximize/close buttons found in the upper-right hand corner. I'm wanting to replace that functionality with a keyboard short-cut and a context menu item, but I can't seem to find an event to trigger to minimize the form.

10 Answers
private void Form1_KeyPress(object sender, KeyPressEventArgs e)
{
     if(e.KeyChar == 'm')
         this.WindowState = FormWindowState.Minimized;
}
FormName.WindowState = FormWindowState.Minimized;

in c#.net

this.WindowState = FormWindowState.Minimized
<form>.WindowState = FormWindowState.Minimized;
Form myForm;
myForm.WindowState = FormWindowState.Minimized;

-- c#.net

NORMALIZE this.WindowState = FormWindowState.Normal;

this.WindowState = FormWindowState.Minimized;

this.WindowState = FormWindowState.Minimized;

Related