How to handle Form.MaximumBox click
everyone! I need to track event when user开发者_如何转开发 is clicking maximumBox in window. It is possible?
Try this : Make use of WindowState property
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());
}
}
You can check the form's window state in the resize event.
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
}
}
精彩评论