-2

I am writing my application in C# in Microsoft Visual Studio and I am facing a problem. I wrote a code that when clicking on the PictureBox, the application should be minimized, but it doesn't. Here is my code:

        private void pictureBox2_Click(object sender, EventArgs e)
        {
            this.WindowState = FormWindowState.Minimized;
        }
avocadoLambda
  • 1,332
  • 7
  • 16
  • 33
  • Does this answer your question? [How to minimize and maximize in C#.Net?](https://stackoverflow.com/questions/7285386/how-to-minimize-and-maximize-in-c-net) and [C# Minimize Whole Application](https://stackoverflow.com/questions/34124971/c-sharp-minimize-whole-application) and [How to minimize a single Windows application form in C#](https://stackoverflow.com/questions/40550178/how-to-minimize-a-single-windows-application-form-in-c-sharp) –  Aug 02 '21 at 09:44

1 Answers1

-2

This code works for me. Seems to be identical. ?

    private void pictureBox1_Click(object sender, EventArgs e)
    {
               this.WindowState = FormWindowState.Minimized;
    }
    enter code here

Could the problem be another setting somwere else that prevents it minimizing? Can you minimize the window with the normal button?