Form.Closing Event fired on Minmize

  • Thread starter Thread starter terrence.jones
  • Start date Start date
T

terrence.jones

Hello All,

I have a modeless child form displayed on top of an owner form. I am
seeing the strange behavior of the modeless form's Closing event being
fired in reponse to the minimize button being pressed on the owner.

Pressing the minimize button of the child works as expected however.

The only messages I see received after pressing Minimize and before
entering the Closing event handler are:

WM_SHOWWINDOW (SW_PARENTCLOSING)
WM_SHOWWINDOW
WM_SHOWWINDOW
WM_WINDOWPOSITIONCHANGING
WM_WINDOWPOSITIONCHANGED
WM_WINDOWPOSITIONCHANGED
WM_SHOWWINDOW

I am at a compelete loss on this one, though as usually, it's probably
something simple.

Thanks.
 
I have a modeless child form displayed on top of an owner form. I am
seeing the strange behavior of the modeless form's Closing event being
fired in reponse to the minimize button being pressed on the owner.

I just ran the same thing, no problem - owner minimized and child did not
get closing event. Does the child window actually close after receiving the
closing event? Is the owner the startup object (or the arg to
Application.Run)?
 
Yes to both questions. The child promptly closes and the owner is the
main startup object. I understand that this is not an expected
behavior so I expect that there is something about my child form that
is resulting in this behavior.

Thanks
 
Back
Top