this.SizeChanged 事件
测试代码如下所示:
public Form5()
{
InitializeComponent();
this.SizeChanged += new EventHandler(Form5_SizeChanged);
}
void Form5_SizeChanged(object sender, EventArgs e)
{
if (this.WindowState == FormWindowState.Normal)
{
this.Text = "窗体还原,时间:" + DateTime.Now.ToString();
}
}
//1.最小化
//WindowState = FormWindowState.Minimized;
////最小化时隐藏窗体
//this.Visible=false;
//2.最大化
//WindowState == FormWindowState.Maximized;
//3.还原为正常
//WindowState == FormWindowState.Normal;