Modal Dialog - Close Event

  • Thread starter Thread starter Krish
  • Start date Start date
K

Krish

Hi,

Im writing a C# based Windows Mobile application.

In our application, on crude exit we would like to persist the form.
We have included the Persist logic in closing event of all forms.

When we have modal dialog, and kill the application from Running
Program... I am not getting any close event on the dialog... Is there
any way we can catch the close event of Modal Dialog

Thanks.
Krish
 
I'd look at adding an IMessageFilter via OpenNETCF's Application2 namespace.
You could then have a message filter looking for the close event.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com
 
Does that mean... we will not even get the close event for the parent
form ???

Let say I have a modeless form A on button click, I launch a modal
form B with A as Owner and kill the application from remove program...
so atleast I should get the close event on parent form?

Thanks,
Krish
 
Not at all.A modal dialog gets its own message pump, so the close event is
sent to the modal form, not its parent or caller.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com


Does that mean... we will not even get the close event for the parent
form ???

Let say I have a modeless form A on button click, I launch a modal
form B with A as Owner and kill the application from remove program...
so atleast I should get the close event on parent form?

Thanks,
Krish
 
Back
Top