window question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Analizer1

    window question

    how to catch the event when a user clicks
    the system menu [x] to close a window
    is FormClosed and FormCloseing the correct Events

    thanks


  • tzarpho

    #2
    Re: window question

    In the InitializeCompo nent method try adding:

    this.Disposed += new System.EventHan dler(this.Form1 _Disposed);

    and then create the method to which the delegate points:

    private void Form1_Disposed( object sender, EventArgs e)

    That should work.

    Kofi Sarfo

    Comment

    • Marc Gravell

      #3
      Re: window question

      Yes.
      FormClosing is called first; this gives you the opportunity to say
      "no" by setting e.Cancel = true (i.e. prompt to save etc). After that,
      the form actually closes and FormClosed is raised.

      Marc

      Comment

      • Analizer1

        #4
        Re: window question

        thanks alog


        "Marc Gravell" <marc.gravell@g mail.comwrote in message
        news:fd28a78c-e63b-437e-a9c6-b614d6f4740a@c3 3g2000hsd.googl egroups.com...
        Yes.
        FormClosing is called first; this gives you the opportunity to say
        "no" by setting e.Cancel = true (i.e. prompt to save etc). After that,
        the form actually closes and FormClosed is raised.
        >
        Marc

        Comment

        Working...