I know that I can get the current state by WindowState, but I want to know if there's any event that will fire up when the user tries to minimize the form.
Form fc = Application. OpenForms["UpdateWindow"]; if (fc != null) fc. Close(); fm.
To remove the minimize, maximize, and close buttons from your form, open your form in Design View. Under the View menu, select Properties. When the Properties window appears, set the "Control Box" property to "No". Now when the form is opened, the buttons will no longer appear in the top right of the form.
In the Properties window, click the Shortcut tab (A). Locate the Run: section, and click the down arrow on the right side (red circle). In the drop-down menu that appears, select Maximized (B). Click Apply (C), and then click OK (D).
You can use the Resize event and check the Forms.WindowState Property in the event.
private void Form1_Resize ( object sender , EventArgs e ) { if ( WindowState == FormWindowState.Minimized ) { // Do some stuff } }
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