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;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With