[英]How to disable maximizing of a window when the window is moved to the top left corner of the screen?
I have a windows which hasResizeMode="CanResizeWithGrip" and AllowTransparency="true" set. 我有一个设置了ResizeMode =“ CanResizeWithGrip”和AllowTransparency =“ true”的窗口。 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. 如何停止最大化播放,以便将屏幕显示为位于屏幕顶部的窗口。
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;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.