Modal Dialog - Close Event

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
 
C

Chris Tacke, eMVP

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
 
K

Krish

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
 
C

Chris Tacke, eMVP

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top