Max window size

I have a function that stores the size of my window:

size_W = this.Width;
size_H = this.Height;

This is normal when I resize the window. However, when using the Maximized button, the window size cannot be saved correctly. How can i do this?

+3
source share
2 answers

Are you after the window size before it was maximized? In WinForms, this is stored in the RestoreBounds property .

+5
source

The standard approach is to save both size and logical value forMainForm.WindowState == FormWindowState.Maximized

+1
source

Source: https://habr.com/ru/post/1705530/


All Articles