Main window hidden after dialog closes

G

Guest

I am developing a WinForms MDI application which opens modal dialogs from time to time, using the ShowModal() method.

Each time a modal dialog is closed the application dissappears to the background and I have to switch away from it and back again to continue.

At first I thought this was only happening in debug mode, but it happens when the app is installed after building in release mode.

I have tried putting a call to this.Activate(), and this.Show() in the main app code after the call to ShowModal(). I have also tried putting this.Owner.Activate() and this.Owner.Show() in the modal dialog code after the call to this.Hide(), but still get the same problem.

Can anyone tell me what is happening and how to stop it please. The application is ready for release and this is the only bug left, but it has me stumped.
 

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