您的位置:首页 > 编程语言 > C#

C# 获取屏幕的大小

2011-08-23 17:23 369 查看
WinForm:

int iActulaWidth = Screen.PrimaryScreen.Bounds.Width;

int iActulaHeight = Screen.PrimaryScreen.Bounds.Height ;

WPF下的:

double dWidth = System.Windows.SystemParameters.PrimaryScreenWidth;

double dHeight = System.Windows.SystemParameters.PrimaryScreenHeight;

double dWidth2 = ActualWidth; //获取此元素的呈现宽度。若此元素时全屏的,则可以获得屏幕大小(-_-!!!)

double dHeight2 = ActualHeight; //获取此元素的呈现高度。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: