Main window hidden after dialog closes

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
Back
Top