Screen size in WPF applications

来源:互联网 发布:网络诈骗七万判几年 编辑:程序博客网 时间:2024/05/01 20:15

WPF 和 Winddows的PrimaryScreen不同用法


Windows form application:

1this.Top = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height - this.Height;
2this.Left = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width - this.Width;

WPF application:

1this.Top = System.Windows.SystemParameters.WorkArea.Height - this.Height;
2this.Left = System.Windows.SystemParameters.WorkArea.Width - this.Width;


[srouce]http://ahmadreza.com/2009/11/20/screen-size-in-wpf-applications/