Closing a dialog form closes the application

Posted by user361633 on Stack Overflow See other posts from Stack Overflow or by user361633
Published on 2010-06-10T16:29:58Z Indexed on 2010/06/10 16:32 UTC
Read the original article Hit count: 262

Filed under:
|

bool CheckAnswer() { DialogForm dialogForm = new DialogForm(); if (dialogForm.showDialog() == System.Windows.Forms.DialogResult.OK) return true; }

The dialog form is invoked by a form created in the main form. When i close the dialog form the application is closed, not just the dialog form! If i invoke the dialog form in other form it works normally. The form from which i invoke the dialog form is top level, but even if i change that i'm getting the same result. Does anyone know what's wrong?

© Stack Overflow or respective owner

Related posts about form

Related posts about dialog