Visual C# Developer Center > Visual C# Forums > Visual C# Language > How do I unsubscribe from a MDIchild form's event.
Ask a questionAsk a question
 

AnswerHow do I unsubscribe from a MDIchild form's event.

  • Wednesday, November 04, 2009 4:00 PMSithlrd Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Has Code
    I've an MDI form that responds to a few events in its children.  When they close, how do I unsubscribe to their events, and where do I put this code (in the parent or in the child)?  Also, when the MDIparent closes, how do I unsubscribe to all their events (I'll put that in the parent's close() event)?

    The line used to subscribe to the child forms' events is:
    frmLocation loc = new frmLocation();
    
    loc.MdiParent = this;
    
    loc.Show();
    
    loc.QuoteDetailsUpdated += new frmLocation.QuoteDetailUpdated(ManageChangedDetails);
    

    Thanks!
    • Changed TypeSithlrd Wednesday, November 04, 2009 4:02 PM
    •  

Answers

All Replies