How to disable maximizing of a window when the window is moved to the top left corner of the screen?
Asked Answered
D

1

2

I have a windows which hasResizeMode="CanResizeWithGrip" and AllowTransparency="true" set. It works fine until it is moved to the top of the screen when it is then automatically Maximized.

How can stop it maximizing so I can display the screen as a window positioned at the top of the screen.

Densimeter answered 20/10, 2013 at 8:14 Comment(3)
possible duplicate of How do you disable Aero Snap in an application?Cathead
This is an OS behavior which you should consider very carefully before overriding it.Grosberg
The normal way to turn off windows snapping is in the Ease of Access Center : windows.microsoft.com/is-is/windows7/…Latreshia
P
0

Try:

private void Window_LocationChanged(object sender, EventArgs e)
{
    this.WindowState = System.windows.WindowState.Normal;
}

If you have to be specific, check for your location:

    if (this.Top == 0)
    {
        this.WindowState = System.windows.WindowState.Normal;
    }
Pitchy answered 21/10, 2013 at 7:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.