I cant find the form event for minimizing/maximizing. Coz I need to show a msgbox whenever a form is minimized
I cant find the form event for minimizing/maximizing. Coz I need to show a msgbox whenever a form is minimized
I think you must override the methods that handles the maxime/minimize event.
How about linking it with the System.EventHandler?
I've read this on a C# book. Though I've never tested it yet.
Put it sa Initialization :
this.Closed += new System.EventHandler(OnClickButton1);
Method :
public void OnClickButton1(object sender, System.EventArgs e) {
Application.Exit();
}
Resize event.
Then check me.WindowState = FormWindowState.Minimized if true.
use deactivate.
c# code convert to vb.net
Code:public partial class Form1 : Form { public Form1() { InitializeComponent(); this.Deactivate+=new EventHandler(Form1_Deactivate); } public void Form1_Deactivate(object sender, EventArgs e) { if (this.WindowState == FormWindowState.Minimized) { MessageBox.Show("test"); } } }
Similar Threads |
|