Modal window blocks all other windows

  • Thread starter Thread starter aagarwal8
  • Start date Start date
A

aagarwal8

Hi,

I have a main form, from which i open a lot of other non-modal forms
(on the same thread). However, as soon as i open a modal form from the
main thread, i am not able to work on any other non-modal forms opened
earlier.

Is there a work around to this situation?

(Perfect analogy would be, any messenger application, where we open a
lot of chat windows, archive window, conference windows etc. and yet
they are all freely accessible even when a modal settings window is
opened)

Regards,
Ankit!
 
I have a main form, from which i open a lot of other non-modal forms
(on the same thread). However, as soon as i open a modal form from the
main thread, i am not able to work on any other non-modal forms opened
earlier.

Is there a work around to this situation?

sure, there are two options:

1. close the modal form

2. make the modal form non-modal

Dirk
 
I am looking forward to a more technical solution.

closing the modal form and making it non-modal is not what i wish to
do.

Any suggestions?

Regards,
Ankit!
 
closing the modal form and making it non-modal is not what i wish to

did you really understand what a modal form is? Maybe you want to read
this article: http://en.wikipedia.org/wiki/Modal_window

modal means that you have to react to the modal form and close it
before you can focus on another form.

i'm sad to tell you, there will not be a workaround for your problem.

Dirk
 
However, as soon as i open a modal form from the
main thread, i am not able to work on any other non-modal forms opened
earlier.

Right. Look up the phrase "by definition."
 
Hi,

I have a main form, from which i open a lot of other non-modal forms
(on the same thread). However, as soon as i open a modal form from the
main thread, i am not able to work on any other non-modal forms opened
earlier.

Is there a work around to this situation?

(Perfect analogy would be, any messenger application, where we open a
lot of chat windows, archive window, conference windows etc. and yet
they are all freely accessible even when a modal settings window is
opened)

Regards,
Ankit!


Assume that
The Modal Form just need to block the Main app Window.
Some other "Independent Forms" do not need to be blocked by the Modal Form.

Then, the only method I think is that open the "Independent Forms" in
separate thread. Since, the Modal Form in the main thread just will
block the window message queue in the same thread. However, the window
in other threads will not be affected.

In Dotnet2 windows form, open the form by "Application.Run(new
FormXXXX)" in a new thread context.
 
Opening windows on separate thread is certainly one of the ways, but
it would involve a lot of thread synchronization for my common data.

However, i figured out a way to achieve what i wanted. I replaced my
ShowDialog() calls with Show(owner) calls. So not the child form never
gets behind the owner form, and other windows are also not blocked.

Regards,
Ankit!

PS: all those who directed me to "the definition"....just try and
think laterally too!! :)
 
However, i figured out a way to achieve what i wanted. I replaced my
ShowDialog() calls with Show(owner) calls. So not the child form never
gets behind the owner form, and other windows are also not blocked.

and so you finally did what I said: ShowDialog opens a modal form and
Show opens a non-modal form.
PS: all those who directed me to "the definition"....just try and
think laterally too!! :)

read documentation before making "wise" comments

Dirk
 
Back
Top