WPF Maximized Window bigger than screen

后端 未结 5 1512
情话喂你
情话喂你 2021-02-19 06:24

When creating a WPF window with AllowsTransparency=\"True\" WindowStyle=\"None\" and maximizing it via this.WindowState = WindowState.Maximized; the Wi

5条回答
  •  粉色の甜心
    2021-02-19 06:57

    A couple year late to the party but just increase your this.borderthickness for the SizeChanged event like so:

    
    ....
    Code
    ....
    
    
    
    public void Window_SizeChanged(object sender, SizeChangedEventArgs e)
        {
            if (this.WindowState == WindowState.Maximized)
            {
                this.BorderThickness = new System.Windows.Thickness(8);
            }
            else
            {
                this.BorderThickness = new System.Windows.Thickness(0);
            }
        }
    

提交回复
热议问题