form.Close problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an application which displays a dialog box (Dialog A). When you press
the close button I want to open a new dialog (Dialog B) and close the first.
But the dialog A is not closed immediatelly. Only after you close dialog B,
dialog A is closed. How is this possible?

Thanks in advance,

Evert Dieperink
 
Hi Evert,

My guess is that you're calling the DialogB.ShowDialog( ) method from within
the CloseButton_Click event of Dialog A. Since Dialog B is shown modally,
Dialog A can't continue processing the CloseButton_Click event and close
itself.

My suggestion would be to have the routine that shows Dialog A also show
Dialog B. Something like this:

\\
DialogA.ShowDialog( )
DialogB.ShowDialog( )
//

Would that work in your situation? If not, please be more specific (code
snippets?).

HTH,
Derrick
 
Back
Top