modal dialogs not modal

C

cassidyc

Hi,

I was wondering if anyone has come accross this issue? And if they have
any solutions

I have that can create new copies of itself
Form1 as = new form1();
af.show();

This form can also bring up a modal dialog (MessageBox)

My problem is that if I bring up the modal dialog from the initial
form. All the forms are inaccessible, the dialog is modal afterall,
which is the desired action

However if I bring the messagebox up from any of the other forms
created from the initial, then all the "child" forms are inaccessible,
but I do have access to the top level form.

It gets wierder, children of the child forms will have the same effect
on all but the initial window

Diagramatically:
X <- initial window
/ \
Y Y
/ \
Z Z

If I bring up a modal dialog from X, I cannot access any forms, X, Y or
Z.

If I bring up a modal dialog from Y, I cannot access Y or Z, but I can
access X.

If I bring up a modal dialog from Z, I cannot access Y or Z, but I can
access X

Is there anyway to make the "child" modal dialogs make the whole
application modal and not just all the child forms?

Thanks

CJC
 
S

Samuel R. Neff

Are you running any multi-threaded operations that may kick off the
modal dialog (either directly or through an event without checking
InvokeRequired)? I've seen the behavior you describe resulting from
multi-threaded operations calling message box and the solution in that
case was to call invoke on the control (which should always be done
anyways).

HTH,

Sam
 
C

cassidyc

Nope, I've got this down the a simple form with 2 buttons, one to pop
up another instance of the form, and another to bring up the
MessageBox, and I am still getting this problem.

I was pointed to a suggestion that I should make the root window the
owner of the dialog, but haven`t tried this yet.

Even so, when I haven`t been doing that, and only setting the owner of
the dialog to be the form that it spawn from I am still getting the
case where dialogs from grandchildren forms are preventing access to
all grandchildren and children, but fail to prevent access to the root
window.

CJC (who will try that tomorrow just to see)
 

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