开发者

Window.Top reads different result in .NET 4 to .NET 3.5

We have a WPF project developed with .NET 3.5, we have converted to .NET 4, to benefit from new features, but, our main window's top & left properties get different results than they did in .NET 3.5

In 3.5: top reads -7, in 4.0: it reads 0 ( when we start the app )

but, if we run the following code, it will read normally as before:

(this as Window).WindowState = System.Windows.WindowState.Normal;
(this as Window).WindowState = System.Windows.WindowState.Maximized;
开发者_Go百科


Well, I assume you mean a maximized window. If you maximize a window, the border will be outside the normal bounds of the screen and thus Top and Left have negative values. It could be that .NET 4 changed this to be zero even if maximized, while .NET 3.5 doesn't.

- SeriTools

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜