首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

获取窗体最大化后的width, height,该怎么解决

2013-09-06 
获取窗体最大化后的width, heightprivate void button1_Click(object sender, EventArgs e){int width1

获取窗体最大化后的width, height


private void button1_Click(object sender, EventArgs e)
{
     int width1 = this.Width;
     this.FormBorderStyle = FormBorderStyle.None;
     this.WindowState = FormWindowState.Maximized;
     this.Update();
     int width2 = this.Width;
}


问题:
现在width1 等于 width2,怎么得到窗体最大化后的width呢?谢谢!
[解决办法]
this.WindowState = FormWindowState.Maximized;
Application.DoEvents();
int width2 = this.Width;

热点排行