What should I do? ---help...  
Author Message
shieldy





PostPosted: Visual C# General, What should I do? ---help... Top

when I'm doing a MDI application, I have to catch the event : when the child window is closed by click the control box. that means I have to do something before dispose the child.

as :

mdiParent is form1, the child window is cld. should I add event process and How

thank you!!




Visual C#11  
 
 
shieldy





PostPosted: Visual C# General, What should I do? ---help... Top

anybody here

 
 
Paul Louth





PostPosted: Visual C# General, What should I do? ---help... Top

Add a FormClosing event:

this.FormClosing += new EventHandler(Form1_FormClosing);

 

private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
    e.Cancel = true;
}


 
 
shieldy





PostPosted: Visual C# General, What should I do? ---help... Top

thanks for your help, and kindness.

 
 
Paul Louth





PostPosted: Visual C# General, What should I do? ---help... Top

No problem :)