Hi guys, it's a little problem but I'm quite stuck with it. I'm
developing a Windows Forms application with VS2008 and I have noticed
this little graphical bug. I have a main form with ShowInTaskbar=true.
I open a modal form (with showdialog()) with ShowInTaskbar=false.
Then, just sometimes, when a use the "Show Desktop" icon or I change
the active program when I go back to mine I can see just the main form
(the modal form is somehow hidden) and obviously it's locked, I can't
interact with it. Neither I can see use the modal form because it's
hidden, so I have to change the active program with ALT+TAB and the go
back to my application. With this move I can get back my modal form
and can continue working. How can I avoid this and keep my modal form
"hidden" from the taskbar?

Thank you in advance for your help

cold

Re: Strange modal form behaviour by Chris

Chris
Tue Jul 08 15:32:00 CDT 2008

"cold80" <cold80@libero.it> wrote in message
news:6b830b92-ffaa-43ed-80ae-80c03d4b6b32@p25g2000hsf.googlegroups.com...
> Hi guys, it's a little problem but I'm quite stuck with it. I'm
> developing a Windows Forms application with VS2008 and I have noticed
> this little graphical bug. I have a main form with ShowInTaskbar=true.
> I open a modal form (with showdialog()) with ShowInTaskbar=false.
> Then, just sometimes, when a use the "Show Desktop" icon or I change
> the active program when I go back to mine I can see just the main form
> (the modal form is somehow hidden) and obviously it's locked, I can't
> interact with it. Neither I can see use the modal form because it's
> hidden, so I have to change the active program with ALT+TAB and the go
> back to my application. With this move I can get back my modal form
> and can continue working. How can I avoid this and keep my modal form
> "hidden" from the taskbar?

Try using the ShowDialog() overload that sets the modal form's owner, e.g.
modalForm = new ModalForm();
modalForm.ShowDialog(this);

Chris Jobson