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

We have a WPF project developed using .NET 3.5, which we converted to .NET 4 to take advantage of the new features, but our top and left properties of the main window get different results than in .NET. 3.5

In 3.5: top reads -7, in 4.0: it reads 0 (when the application starts)

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

 (this as Window).WindowState = System.Windows.WindowState.Normal; (this as Window).WindowState = System.Windows.WindowState.Maximized; 
+4
source share
1 answer

Well, I assume that you mean the maximally maximized window. If you maximize the window, the border will be outside the normal borders of the screen, and thus the top and left have negative values. Perhaps .NET 4 changed this value to zero, even if it was maximized, but .NET 3.5 did not.

- SeriTools

+1
source

All Articles