Make my wpf application Full Screen (Cover taskbar and title bar of window)

后端 未结 9 1887
心在旅途
心在旅途 2020-12-05 14:34

I would like to make my application such that it can maximize to full screen means it hide the windows task bar and the title bar as well. And it should triggered by a butto

相关标签:
9条回答
  • 2020-12-05 15:22

    Try this:

    <Window ShowTitleBar="False" IgnoreTaskbarOnMaximize="True">
    
    0 讨论(0)
  • 2020-12-05 15:28

    You need to set the ResizeMode to NoResize and WindowState to Maximized

      <Window ...    
        ResizeMode="NoResize" WindowState="Maximized">
    
    0 讨论(0)
  • 2020-12-05 15:31

    Simply hook this event handler to the Loaded event of the form, works fine.
    Do not apply this stuff in the constructor of the form (which won't work for me).

        private void aWindow_Loaded(object sender, RoutedEventArgs e)
        {
            MaxHeight = SystemParameters.FullPrimaryScreenHeight;
            MaxWidth = SystemParameters.FullPrimaryScreenWidth;
            Width = SystemParameters.FullPrimaryScreenWidth;
            Height = SystemParameters.FullPrimaryScreenHeight;
            WindowState = WindowState.Maximized;
            ResizeMode = ResizeMode.NoResize;
            Left = 0;
            Top = 0;
            Topmost = true;
            ShowInTaskbar = false;
    
            //throw new NotImplementedException();
        }
    
    0 讨论(0)
提交回复
热议问题