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.

Marc
  • 12,706
  • 7
  • 61
  • 97
user2840301
  • 67
  • 1
  • 1
  • 7
  • 1
    possible duplicate of [How do you disable Aero Snap in an application?](http://stackoverflow.com/questions/2470685/how-do-you-disable-aero-snap-in-an-application) – Rohit Vats Oct 20 '13 at 08:58
  • This is an OS behavior which you should consider very carefully before overriding it. – slugster Oct 20 '13 at 09:30
  • The normal way to turn off windows snapping is in the Ease of Access Center : http://windows.microsoft.com/is-is/windows7/how-do-i-turn-snap-on-or-off – aybe Oct 20 '13 at 14:41

1 Answers1

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;
    }
ouflak
  • 2,458
  • 10
  • 44
  • 49