Le réseau pour les développeurs > Forums - Accueil > Visual C# Language > How do I unsubscribe from a MDIchild form's event.
Poser une questionPoser une question
 

TraitéeHow do I unsubscribe from a MDIchild form's event.

  • mercredi 4 novembre 2009 16:00Sithlrd Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     A du 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!
    • Type modifiéSithlrd mercredi 4 novembre 2009 16:02
    •  

Réponses

Toutes les réponses