Get window size in maximized version in winforms

How can I get the size a form would have in a Maxized windowstate without maximizing it?

I take a picture of the map control. I want to maximize the window when taking a snapshot, but without notifying the user. It seems that the state of the form window does not change the size of the form when it is hidden:

this.Hide(); this.WindowState = FormWindowState.Maximized; // Snapshot but this.Size didn't change this.WindowState = FormWindowState.Normal; this.Show(); 

It works great when not hiding.

So, I'm trying to set the size manually, but you need to know the maximum width and height of the state:

 // x & y ??? this.Size = new Size(x,y); 
+4
source share
2 answers

You can read the size of workingarea-screen .

+5
source

Try the SuspendLayout() function to pause the on-screen layout update. ResumeLayout() calling ResumeLayout() , you can resume this.

0
source

All Articles