Maximize WPF Window on the current screen

后端 未结 10 686
谎友^
谎友^ 2021-01-31 07:35

I have a windowless wpf application, whenever I set the window state as maximized it maximizes it on the primary display.

What I would like to do is have it maximize on

10条回答
  •  无人及你
    2021-01-31 08:07

    We cannot maximize the window until it's loaded. So by hooking the Loaded event of fullScreenWindow and handling the event along the lines of:

    private void Window_Loaded(object sender, RoutedEventArgs e) 
    {
        WindowState = WindowState.Maximized;
    }
    

提交回复
热议问题