Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Problem with Modal Form

Problem with Modal Form

Scheduled Pinned Locked Moved C#
helpquestioncsharp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MehmetFurkan
    wrote on last edited by
    #1

    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

    A L 2 Replies Last reply
    0
    • M MehmetFurkan

      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

      A Offline
      A Offline
      Anindya Chatterjee
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • M MehmetFurkan

        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

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        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|


        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups