Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to programmatically minimize a window

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;

There's no point minimizing an already minimized form. So here we go:

if (form_Name.WindowState != FormWindowState.Minimized) form_Name.WindowState = FormWindowState.Minimized;