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); // 设置窗体高度

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM