
c#取得屏幕宽高怎么不行?
privateintclientWidth=System.Windows.Forms.Screen.GetWorkingArea(this).Width;privatec...
private int clientWidth=System .Windows .Forms .Screen .GetWorkingArea (this).Width ;
private const int clientWidth=System .Windows .Forms .Screen .GetWorkingArea (this).height;
为什么这样取屏幕宽高不行?
我用 private int clientHeight=System .Windows .Forms .Screen .PrimaryScreen .Bounds .Height ;
private int clientWidth = System.Windows.Forms.Screen.PrimaryScreen .Bounds .Width ;
这样就可以. 展开
private const int clientWidth=System .Windows .Forms .Screen .GetWorkingArea (this).height;
为什么这样取屏幕宽高不行?
我用 private int clientHeight=System .Windows .Forms .Screen .PrimaryScreen .Bounds .Height ;
private int clientWidth = System.Windows.Forms.Screen.PrimaryScreen .Bounds .Width ;
这样就可以. 展开
4个回答
展开全部
WorkingArea 取得的并不是屏幕的宽和高,而是程序运行可以使用的 屏幕上的某个范围,这个范围,会因为桌面的工具栏之类的存在,而有所改变,所以并不等同于 屏幕的宽和高, 通常是小一些
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
GetWorkingArea (this)不能直接在赋值语句中用
要在前面先用GetWorkingArea (this)取屏幕
再对取到的屏幕求值
要在前面先用GetWorkingArea (this)取屏幕
再对取到的屏幕求值
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
高度
int h = Screen.PrimaryScreen.WorkingArea.Height;
宽度
int k = Screen.PrimaryScreen.WorkingArea.Width;
int h = Screen.PrimaryScreen.WorkingArea.Height;
宽度
int k = Screen.PrimaryScreen.WorkingArea.Width;
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
去CSDN论坛里问问,我也是学。net的,都是那里得答案!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询