Strange modal form behaviour

  • Thread starter Thread starter cold80
  • Start date Start date
C

cold80

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
 
cold80 said:
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
 
Back
Top