By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,928 Members | 1,752 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,928 IT Pros & Developers. It's quick & easy.

modal dialogs not modal

P: n/a
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

Nov 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

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
On 5 May 2005 05:19:03 -0700, ca******@gmail.com wrote:
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


Nov 17 '05 #2

P: n/a
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)

Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.