I've not seen this behavior before, but here are some pointers which might
help:
1) always make the application's main form the PARENT of the modal dialog.
Don't ever open a modal dialog with the desktop as parent for example.
2) in the properties of a dialog, you can specify to show the dialog in the
taskbar. It might be a good idea to switch this on. The modal dialog will get
its own button in the taskbar and if the dialog gets hidden or minimized, the
user can select it again by clicking the button in the taskbar
3) never ever open 2 modal dialogs at once. The concept of a modal dialog is
to make sure the user fulfills the dialog before continuing with the
application. If you need to open more than one, consider other layouts of the
UI.
4) modal dialogs don't need to have their topmost flag set to true. I have
found that setting that flag gives odd results.

        FB

> Strangely, I've been hitting this problem. Having been a java programmer in
> the past, I was very surprised when the same problems exhibited themselves
> in .NET.
>
> The problem is namely thus:
> When using modal dialogs (custom or system provided), you can end up with a
> situation whereby the modal dialog has not been destroyed or closed, and is
> either invisible or can't be see/rendered - either because the Z-Order is
> stuffed (ie it always renders behind another dialog that is not modal) or
> the dialog is just invisible. Sometimes the user can get back control doing
> alt-tab. More often than not, the application just becomes stuck.
>
> This creates the following situation - the user can't interact with your app
> any longer. The only way they can close the app is to do a ctrl-alt-del and
> kill the process. The annoying part about this is that it is indeterminate -
> sometimes it occurs, other times it just works. But the end result is a
> stuck application with no way to recover.
>
> Firstly, has anybody experienced this sort of thing and how did they go
> about fixing it? I'm tempted to rip up all my modal dialog code and just go
> modaless - and rely on callbacks and states rather than on deterministic
> 'blocking' and handle user input blocking myself. Seems a bloody awful waste
> of time - to have to re-implement modality though.
>
> Secondly, the application I have written is more than just a few simple
> dialogs. I have modal dialogs, which open other modal dialogs. I'm wandering
> if this is this the cause of the problem? I've written a simple test, and
> the behaviour looks ok - but with all things, once it's in a real app,
> things are different.
>
> I've tried ALL available solutions include providing a suitable/accurate
> parent (the top most form), but somehow either .NET or Window's just can't
> render things properly. And the problem seems to occur for both system
> provided dialogs (including MessageBox, OpenFileDialog,
> OpenDirectoryDialogs) and my own forms.
>
> --
> Cheers,
> Jason
>
> ===================================
> This list is hosted by DevelopMentorR  http://www.develop.com
>
> View archives and manage your subscription(s) at http://discuss.develop.com

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to