这个问题so简单,只值5分

raulfan 2002-10-30 02:01:13
怎样获取当前Form的Width&Height,及获得系统屏幕的Width&Height?
...全文
22 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
rbjojo 2002-11-15
  • 打赏
  • 举报
回复
Rectangle矩形类
raulfan 2002-11-14
  • 打赏
  • 举报
回复
Rectangle是什么?哪有定义
SuperBright 2002-11-14
  • 打赏
  • 举报
回复
1.this.width & this.Height
2.如果你只有一个Screen用:
Screen.PrimaryScreen.Bounds.Width;
Screen.PrimaryScreen.Bounds.Height;
如果你有多个Screen用

int x ;
int y ;

int index;
int upperBound;

Screen [] screens = Screen.AllScreens;
upperBound = screens.GetUpperBound(0);

for(index = 0; index <= upperBound; index++)
{
// For each screen
x=screens[index].Bounds.Width;

y=screens[index].Bounds.Height;
}
faygoo 2002-11-14
  • 打赏
  • 举报
回复
Rectangle r = Screen.PrimaryScreen.Bounds;
int i = r.Width;
int j = r.Height;
int x = r.X;
int y = r.Y;
raulfan 2002-11-14
  • 打赏
  • 举报
回复
up
raulfan 2002-10-30
  • 打赏
  • 举报
回复
请问dc是啥?
yarshray 2002-10-30
  • 打赏
  • 举报
回复
1.this.width & this.Height
2.dc.width & dc.height

111,117

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧