Windows Standard Actions Form [Minimize - Maximize - Close]

0

I'm using visual studio - Windows Forms, and by default the form has the "Minimize" form control buttons from "Maximize" > and another to Close the form that is an "X" I need to manipulate the actions within them, more specifically I want the program to minimize hide in the form. Anyone know of any way to do this?

    
asked by anonymous 17.10.2017 / 21:31

1 answer

2

You can manipulate the Resize event:

    private void Form1_Resize(object sender, EventArgs e)
    {
        if (this.WindowState == FormWindowState.Minimized)
        {
            this.Hide();
        }
        else
        {
            this.Show();
            this.BringToFront();
        }
    }

If you want to define this for all forms, you need to make a basic form that should be inherited by others.

    
17.10.2017 / 21:34