Re: SDI interface and modal forms
Eyvind Axelsen <[email protected]>
| Newsgroups | gmane.comp.windows.devel.dotnet.winforms |
|---|---|
| Message-ID | <[email protected]> |
While that is possible, the scenario below is only an example - there might be many open forms, and if there is another way I would rather not convolute my code with keeping track of and hiding every non-modal form, but if there is no other way...? Eyvind. -----Opprinnelig melding----- Fra: Discussion forum for developers using Windows Forms to build apps and controls [mailto:[email protected]] På vegne av Chris Bordeman Sendt: 1. juni 2007 16:57 Til: [email protected] Emne: Re: [DOTNET-WINFORMS] SDI interface and modal forms Hide Form1 before you open Form3. -----Original Message----- From: Discussion forum for developers using Windows Forms to build apps and controls [mailto:[email protected]] On Behalf Of Eyvind Axelsen Sent: Friday, June 01, 2007 9:11 AM To: [email protected] Subject: [DOTNET-WINFORMS] SDI interface and modal forms Imagine, if you will, this scenario: - An application has three forms, Form1, Form2 and Form3 - A startup, Form1 opens in a maximized windowstate. - From a button on Form1, you can open Form2, which also is in a maximized state. The user will want to be able to switch between Form1 and Form2 with ALT+TAB. So far, so good. - From a button on Form2, the user may start Form3, which is opened as a modal dialog with ShowDialog(). - And now, for the tricky part: the user decides that he/she wants to do something in Form1 before returning to Form3, and presses ALT+TAB. This brings up Form1, but none of the buttons on it are clickable, since the application is in a modal state waiting for Form3 to be closed. This, however is not evident to the user, which cannot be expected to grasp the concept of modality when Form3 is not visible, and may as such be classified as "user hostile" behavior. So, the question is: how can you prevent forms from being accessible via ALT+TAB or the Windows task bar when a modal dialog is open? Was that at all understandable? Thanks, Eyvind.