Problem with Modal Form
-
Hi, I have a few forms in my C# windows application. On main form, by a button, another form is shown. On this second form, by a button, another form is shown MODALLY ( ShowDialog() ). In such stiuation, when another application (ex: windows explorer) becomes activated, then my application reactivated using application-icons on windows Task Bar, my Main form appears on top and does not respond to user because another form is shown modally which actually does not appear. In fact, here, when windwos' Alt-Tab browsing is used, it seems no problem. How can I ensure the last opened form to bring to front in such cases? I know it seems a small problem but really bothering.. Thanks for you help
-
Hi, I have a few forms in my C# windows application. On main form, by a button, another form is shown. On this second form, by a button, another form is shown MODALLY ( ShowDialog() ). In such stiuation, when another application (ex: windows explorer) becomes activated, then my application reactivated using application-icons on windows Task Bar, my Main form appears on top and does not respond to user because another form is shown modally which actually does not appear. In fact, here, when windwos' Alt-Tab browsing is used, it seems no problem. How can I ensure the last opened form to bring to front in such cases? I know it seems a small problem but really bothering.. Thanks for you help
You can test the following code snippets:
private void mnuAbout_Click(object sender, System.EventArgs e) { Form f = new Form(); f.ShowDialog(this); }
Anindya Chatterjee
-
Hi, I have a few forms in my C# windows application. On main form, by a button, another form is shown. On this second form, by a button, another form is shown MODALLY ( ShowDialog() ). In such stiuation, when another application (ex: windows explorer) becomes activated, then my application reactivated using application-icons on windows Task Bar, my Main form appears on top and does not respond to user because another form is shown modally which actually does not appear. In fact, here, when windwos' Alt-Tab browsing is used, it seems no problem. How can I ensure the last opened form to bring to front in such cases? I know it seems a small problem but really bothering.. Thanks for you help
Yes, setting the owner of a dependent form should do it. :)
Luc Pattyn [Forum Guidelines] [My Articles]
I dislike the black-and-white voting system on questions/answers. X|