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. Little Red 'X' on MDI

Little Red 'X' on MDI

Scheduled Pinned Locked Moved C#
question
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.
  • D Offline
    D Offline
    Dwayner79
    wrote on last edited by
    #1

    When The RED X on the parent form is pressed, what is run? It seems like the child form_Closing runs prior to the Parent form_Closing event. I need to capture the X press before it does ANYTHING... including kill the child form. Any ideas? Thanks ***************** "We need to apply 21st-century information technology to the health care field. We need to have our medical records put on the I.T." —GW -- modified at 11:12 Friday 21st October, 2005

    L 1 Reply Last reply
    0
    • D Dwayner79

      When The RED X on the parent form is pressed, what is run? It seems like the child form_Closing runs prior to the Parent form_Closing event. I need to capture the X press before it does ANYTHING... including kill the child form. Any ideas? Thanks ***************** "We need to apply 21st-century information technology to the health care field. We need to have our medical records put on the I.T." —GW -- modified at 11:12 Friday 21st October, 2005

      L Offline
      L Offline
      Libor Tinka
      wrote on last edited by
      #2

      Add this simple code to your main form class: protected override void OnClosing(CancelEventArgs cea) { if (there are any MDIs) cea.Cancel = true; else base.OnClosing(cea); // not necessary, but nice }

      D 1 Reply Last reply
      0
      • L Libor Tinka

        Add this simple code to your main form class: protected override void OnClosing(CancelEventArgs cea) { if (there are any MDIs) cea.Cancel = true; else base.OnClosing(cea); // not necessary, but nice }

        D Offline
        D Offline
        Dwayner79
        wrote on last edited by
        #3

        Great... thanks, I think I can get the rest... will write back if not. Cheers ***************** "We need to apply 21st-century information technology to the health care field. We need to have our medical records put on the I.T." —GW

        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