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. Windows list dropdown problem

Windows list dropdown problem

Scheduled Pinned Locked Moved C#
helpquestiondiscussion
3 Posts 2 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
    Matthew Cuba
    wrote on last edited by
    #1

    Hello, I have several MDI child windows for my application. These show up in the Windows list dropdown menu when I open them. When the user clicks on the X to "close" the child window, I just want to hide it so I capture this in my FormClosing event handler for each of them doing this: if (e.CloseReason == CloseReason.UserClosing) { e.Cancel = true; Hide(); } Which hides the child window just fine, however, when I want to redisplay it, clicking on the appropriate control to call Show() for that window, it displays just fine but I don't get an entry in my Windows list dropdown menu for that item. Any thoughts? Thanks, Matt

    C 1 Reply Last reply
    0
    • M Matthew Cuba

      Hello, I have several MDI child windows for my application. These show up in the Windows list dropdown menu when I open them. When the user clicks on the X to "close" the child window, I just want to hide it so I capture this in my FormClosing event handler for each of them doing this: if (e.CloseReason == CloseReason.UserClosing) { e.Cancel = true; Hide(); } Which hides the child window just fine, however, when I want to redisplay it, clicking on the appropriate control to call Show() for that window, it displays just fine but I don't get an entry in my Windows list dropdown menu for that item. Any thoughts? Thanks, Matt

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      How do they get into your drop down list to start with ? That's obviously where the problem is.

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

      M 1 Reply Last reply
      0
      • C Christian Graus

        How do they get into your drop down list to start with ? That's obviously where the problem is.

        Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

        M Offline
        M Offline
        Matthew Cuba
        wrote on last edited by
        #3

        Christian Graus wrote:

        How do they get into your drop down list to start with ? That's obviously where the problem is.

        Well, I believe I just followed the steps outlined in the MS documentation to do this. I set my main form's IsMdiContainer property to true. I added a menustrip via the designer. The entries are added by setting the MdiWindowListItem property of the menuStrip to the desired menu item (In my test case, "windowToolStripMenuItem") from within the designer and then I call the following when I want form2 to show: form2.MdiParent = this; form2.Show(); The problem seems to me to be when I handle the FormClosing and set e.Cancel = true. I don't know what is going on behind the scenes to manage the list of windows that show up in the menu. I can call Hide() on form2 from its parent window, form1,and when I use the control to show form2 again it shows up in the window list as I would expect. Anyway, thanks for the quick response. Matt

        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