C#获取屏幕分辨率

double workWidth = SystemParameters.WorkArea.Width; // 屏幕工作区域宽度
double workHeight = SystemParameters.WorkArea.Height; // 屏幕工作区域高度
double screenWidth = SystemParameters.PrimaryScreenWidth; // 屏幕整体宽度
double screenHeight = SystemParameters.PrimaryScreenHeight; // 屏幕整体高度
this.Width = (int)(workWidth * 0.8 + 0.5); // 设置窗体宽度
this.Height = (int)(workHeight * 0.8 + 0.5); // 设置窗体高度

 

posted @   Avin  阅读(6439)  评论(1编辑  收藏  举报
点击右上角即可分享
微信分享提示