问题
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.
回答1:
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;
}
来源:https://stackoverflow.com/questions/19475258/how-to-disable-maximizing-of-a-window-when-the-window-is-moved-to-the-top-left-c