开发者

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

       }



   }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜