Borderless window application takes up more space than my screen resolution

前端 未结 8 715
忘了有多久
忘了有多久 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:30

    I solved the problem this way:

    XAML:

    WindowStyle="None"
    Left="0"
    Top="0"
    Width="{Binding WPFSettings.Width}"
    Height="{Binding WPFSettings.Height}">
    

    Visual Basic:

    Public Class WPFSettings
       Public ReadOnly Property Width() As Double
          Get
             Return System.Windows.SystemParameters.PrimaryScreenWidth
          End Get
       End Property
    
       Public ReadOnly Property Height() As Double
          Get
             Return System.Windows.SystemParameters.PrimaryScreenHeight
          End Get
       End Property
    End Class
    

    It works pretty good.

    0 讨论(0)
  • 2021-01-02 05:30

    In my case the XAML tag of the Window had the Property SizeToContent="True" and all I had to do was to remove it.

    0 讨论(0)
提交回复
热议问题