OnClosing is not called when I press my window 'X'

  • Thread starter Thread starter Ernesto
  • Start date Start date
E

Ernesto

Hi everybody:

I have a dialog class inherited from Form. It has several list views
that are populated by several threads.

My problem is that my overridden OnClosing(CancelEventArgs e) method
is not called while the threads are populating my window.

I also have one "Cancel" button. My button closes my dialog when it's
pressed but the "X" dialog button does nothing while the threads are
working.

What am I doing wrong? My threads populate the list views using
listView.Invoke

Thanks in advance



Ernesto
 
While a form is shown as DialogBox by calling Form.ShowDialog(), the "x"
button does not CLOSE the form ( as if you call Form.Close()), it hide the
Form instead, by setting Form.DialogResult=DialogResult.Cancel.
 
Back
Top