How to set the location of WPF window to the bottom right corner of desktop?

后端 未结 7 2018
太阳男子
太阳男子 2020-12-07 20:39

I want to show my window on top of the TaskBar\'s clock when the windows starts.

How can I find the bottom right corner location of my desktop?

7条回答
  •  猫巷女王i
    2020-12-07 21:15

    To access the desktop rectangle, you could use the Screen class - Screen.PrimaryScreen.WorkingArea property is the rectangle of your desktop.

    Your WPF window has Top and Left properties as well as Width and Height, so you could set those properties relative to the desktop location.

提交回复
热议问题