#StackBounty: #c# #wpf #resolution #screen-resolution C# WPF fit application depending on monitor size after maximize/minimize after mo…

Bounty: 50

I have two monitors:

Screen 1: which is secondary screen with 1920×1080

Screen 2: which is primary screen with 1600×900

Screen 1 is larger then Screen 2.

When I open my application in Screen 2, and then move it from screen 2 to screen 1 and try to minimize and then maximize my application, the maximum size is taken by screen 2, and not by current monitor size(it doesn’t appear maximized related to monitor size)

How I can edit my code so in maximize and minimize to take the screen resolution where the application exist now instead of taking it depending on the primary monitor?

I am using the code in this thread for the matter of resizing:
https://blogs.msdn.microsoft.com/llobo/2006/08/01/maximizing-window-with-windowstylenone-considering-taskbar/

Which is same as this reply:
https://stackoverflow.com/a/6315427/5825468

Thanks


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.