Strange modal form behaviour

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
 
C

Chris Jobson

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top