0

When maximizing my c# winforms app I am seeing some inconsistency. If I have a smaller screen resolution on my primary monitor, maximizing the application will fill the screens working area on that screen, but not on a larger secondary monitor. For example, if I have a 1280 x 1024 primary screen, and a 1920 x 1080 secondary screen, the application will only maximize to the working area of the 1280 x 1024 screen.

I've tried changing the maximize bounds before maximizing, but for some reason the form ends up maximizing to a larger size. I grabbed the width and height of the current screen from Screen.FromControl(this).WorkingArea and set new bounds with x and y = 0. The form background still overflows over the taskbar, and onto an additional screen.

Does anyone have any suggestions?

  • The `WorkingArea` is in secondary screen? What if you do inverse the primary screen to be a larger one? – Tấn Nguyên Jul 06 '20 at 16:28
  • Check the DpiAwareness part of the notes here: [Using SetWindowPos with multiple monitors](https://stackoverflow.com/a/53026765/7444103). You will need `Per-Monitor V2` (Windows 10 1703+ and .Net Framework 4.7+ only) or check/adapt the size when a new Form is opened (verify the screen bounds where the Form is shown). A DpiAware app is necessary in any case, otherwise you'll get virtualized measures. – Jimi Jul 06 '20 at 17:09

0 Answers0