c# 窗口如何获取windows 分辨率大小

来源:百度知道 编辑:UC知道 时间:2024/06/19 22:03:30

this.Width = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width;
this.Height = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height;

Rectangle rect = new Rectangle();
rect = Screen.GetWorkingArea(this);
MessageBox.Show ( "本机器的分辨率是" + rect.Width.ToString ( ) + "*" + rect.Height.ToString ( ) ) ;

SystemInformation.VirtualScreen.Height.ToString()和SystemInformation.VirtualScreen.Width.ToString()。
其中SystemInformation这个类是提供当前系统环境的有关信息的类。

......................一楼二楼的都对!