////这个区域不包括任务栏的
Rectangle ScreenArea = System.Windows.Screen.GetWorkingArea(this);
////这个区域包括任务栏,就是屏幕显示的物理范围
Rectangle ScreenArea = System.Windows.Forms.Screen.GetBounds(this);
int width1 = ScreenArea.Width; //屏幕宽度
int height1 = ScreenArea.Height; //屏幕高度
//silverlight中得到浏览器的实际高度 宽度
double height2 = (Application.Current.RootVisual as UserControl).ActualHeight;
double width2 = (Application.Current.RootVisual as UserControl).ActualWidth;
窗体的宽度和高度
最新推荐文章于 2024-09-20 20:30:15 发布