大家好! 当用户在窗口中单击maximumBox时,我需要跟踪事件。 有可能吗?
答案 0 :(得分:5)
试试这个:使用WindowState属性
private void Form1_Resize(object sender, EventArgs e)
{
if (this.WindowState == FormWindowState.Maximized)
{
\\ code to execute after Maximize button has been clicked
MessageBox.Show(this.WindowState.ToString());
}
}
答案 1 :(得分:1)
您可以在resize事件中检查表单的窗口状态。
private void Form1_Resize(object sender, EventArgs e)
{
if (this.WindowState == FormWindowState.Maximized)
{
\\ code to execute after Maximize button has been clicked
}
if (this.WindowState == FormWindowState.Minimized)
{
\\ code to execute after Minimize button has been clicked
}
}