Maximize WPF Window on the current screen

后端 未结 10 972
谎友^
谎友^ 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:24

    Look at this question and answer: How to center a WPF app on screen?

    You can use the described functions in Windows.Forms.Screen to get the current screen. Then maybe setting the windows' StartupLocation to this screen (before maximizing as you already did) may achieve what you want, but I didn't take the time to try it myself, to be honest.

提交回复
热议问题