我想在主屏幕上启动时将我的 WPF 应用居中。我知道我必须设置 myWindow.Left 和 myWindow.Top,但我从哪里获得这些值?
我找到了 System.Windows.Forms.Screen.PrimaryScreen
,这显然不是 WPF。是否有 WPF 替代方案可以提供屏幕分辨率或类似信息?
最佳答案
xaml
<Window ... WindowStartupLocation="CenterScreen">...
关于c# - 如何使 WPF 应用程序在屏幕上居中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/935599/