日期:2014-05-17  浏览次数:20731 次

获取窗体最大化后的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;