C#.NET Forms programing - Modal and Non-Modal forms problem

Posted by Povilas on Stack Overflow See other posts from Stack Overflow or by Povilas
Published on 2010-05-14T14:18:18Z Indexed on 2010/05/14 14:24 UTC
Read the original article Hit count: 576

Filed under:
|
|
|

Hello,

I have a problem with modality of the forms under C#.NET. Let's say I have main form #0 (see the image below). This form represents main application form, where user can perform various operations. However, from time to time, there is a need to open additional non-modal form to perform additional main application functionality supporting tasks. Let's say this is form #1 in the image. On this #1 form there might be opened few additional modal forms on top of each other (#2 form in the image), and at the end, there is a progress dialog showing a long operation progress and status, which might take from few minutes up to few hours. The problem is that the main form #0 is not responsive until you close all modal forms (#2 in the image). I need that the main form #0 would be operational in this situation. However, if you open a non-modal form in form #2, you can operate with both modal #2 form and newly created non modal form. I need the same behavior between the main form #0 and form #1 with all its child forms. Is it possible? Or am I doing something wrong? Maybe there is some kind of workaround, I really would not like to change all ShowDialog calls to ShowDialog...

Image

Thanks, Povilas

© Stack Overflow or respective owner

Related posts about c#

Related posts about forms