How can I disable window maximization when moving the window to the top left corner of the screen?

I have windows that have hasResizeMode = "CanResizeWithGrip" and AllowTransparency = "true". It works great until it is moved to the top of the screen when it is automatically maximized.

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

+1


source to share


1 answer


Try:

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

      



If you need to be specific, check your location:

    if (this.Top == 0)
    {
        this.WindowState = System.windows.WindowState.Normal;
    }

      

0


source







All Articles