467,882 Members | 1,140 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,882 developers. It's quick & easy.

modal dialogs not modal

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
  • viewed: 2276
Share:
2 Replies

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
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.

Similar topics

2 posts views Thread by Bjoern Obermeyer | last post: by
2 posts views Thread by Ricky K. Rasmussen | last post: by
10 posts views Thread by Guadala Harry | last post: by
1 post views Thread by wendy | last post: by
2 posts views Thread by sthrudel | last post: by
7 posts views Thread by proximus | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.