最大化:
在设置WindowStyle=”None” AllowsTransparency=”True”后,最大化会覆盖任务栏;
解决办法:
设置窗口最大值,如下:
this.MaxHeight = System.Windows.Forms.SystemInformation.WorkingArea.Height; this.MaxWidth = System.Windows.Forms.SystemInformation.WorkingArea.Width;
获取当前屏幕工作区间大小,并赋值。
会存在一个问题,偏移。
处理办法(XML)设置窗口属性:
ResizeMode=”NoResize”。
移动问题:
public MainWindow() { InitializeComponent(); this.MouseDown+= new MouseButtonEventHandler(Window_MouseDown); ……………… } private void Window_MouseDown(object sender, MouseButtonEventArgs e) { this.DragMove(); }