开发者

screen resolution issue when manually maximizing application

In our WPF applicaiton, we're using WindowStyle="None" in order to give our application a more custom look. The maximize/minimize buttons are in the same place, but styled the way we wa开发者_如何转开发nt them.

As such, we're hijacking the maximize and minimize behavior and doing it manually. We're doing the following:

this.Top = myScreen.WorkingArea.Top;
this.Left = myScreen.WorkingArea.Left;
this.Width = myScreen.WorkingArea.Width;
this.Height = myScreen.WorkingArea.Height;

Here, myScreen is the Screen where the center point of the application lies, in the event the user is running on a multi-monitor setup.

On certain setups, and with seemingly no connection, hitting the maximize button will extend the size of the application way past the actual, viewable area of the monitor. It fails this way on my and another developers setup, but my bosses multi-monitor setup it works just fine.

My monitor setup is as follows:

Monitor 2 (left)

Top, Left: 0, -1280
Resolution: 1280, 1024

Monitor 1 (right, laptop)

Top, Left: 0, 0
Resolution: 1680, 1050

When I manually resize the application to the size it should be when maximized, I get the following values:

Top, Left: 0, -1024
Height, Width: 792, 1024

I fairly recently updated the display drivers on my laptop, and no newer ones exist. Other than that I can't explain this phenomenon. Does anyone else have any experience with this? Is this perhaps a dots-per-pixel conversion issue or something? I can't find any answers from here or searching google... Any help would be greatly appreciated!


Have you seen this page - Maximizing window (with WindowStyle=None) considering Taskbar? Also, here is a developer's blog entry on a control he made that does this (hasn't released the source code yet, but claims it will be released soon).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜