Borderless window application takes up more space than my screen resolution

前端 未结 8 711
忘了有多久
忘了有多久 2021-01-02 04:55

I have created a borderless application in WPF, and it works pretty good. However, when I set the WindowState to full screen, the application takes up more space than my scr

8条回答
  •  清酒与你
    2021-01-02 05:08

    I needed this to work across different size displays (like most people it sounds). So I simply did this...

    
    ....
    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);
            }
        }
    

提交回复
热议问题