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. Make main window wait for message box

Make main window wait for message box

Scheduled Pinned Locked Moved C#
questionhelp
5 Posts 4 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.
  • L Offline
    L Offline
    Lee Reid
    wrote on last edited by
    #1

    Hi guys/girls, When you use MessageBox.Show("message here"), the programme will effectively freeze and wait for you to press OK on the message box before continuing in the code. How do I make this happen for my own custom built pop-up windows? I'm sure this should be simple but i'm stumped :( Any help would be great! Thanks in advance :) Lee

    D M F 3 Replies Last reply
    0
    • L Lee Reid

      Hi guys/girls, When you use MessageBox.Show("message here"), the programme will effectively freeze and wait for you to press OK on the message box before continuing in the code. How do I make this happen for my own custom built pop-up windows? I'm sure this should be simple but i'm stumped :( Any help would be great! Thanks in advance :) Lee

      D Offline
      D Offline
      dan sh
      wrote on last edited by
      #2

      How are you showing them? Using Show method? Use ShowDialog instead.

      It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD

      L 1 Reply Last reply
      0
      • L Lee Reid

        Hi guys/girls, When you use MessageBox.Show("message here"), the programme will effectively freeze and wait for you to press OK on the message box before continuing in the code. How do I make this happen for my own custom built pop-up windows? I'm sure this should be simple but i'm stumped :( Any help would be great! Thanks in advance :) Lee

        M Offline
        M Offline
        Mirko1980
        wrote on last edited by
        #3

        Use the ShowDialog method :)

        1 Reply Last reply
        0
        • D dan sh

          How are you showing them? Using Show method? Use ShowDialog instead.

          It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD

          L Offline
          L Offline
          Lee Reid
          wrote on last edited by
          #4

          SOLVED! Thanks so much! When you're new, the smallest things can be so retardedly difficult to find solutions for...

          1 Reply Last reply
          0
          • L Lee Reid

            Hi guys/girls, When you use MessageBox.Show("message here"), the programme will effectively freeze and wait for you to press OK on the message box before continuing in the code. How do I make this happen for my own custom built pop-up windows? I'm sure this should be simple but i'm stumped :( Any help would be great! Thanks in advance :) Lee

            F Offline
            F Offline
            freakyit
            wrote on last edited by
            #5

            Hi, Take a look at the MessageBox.Show() overloads. There is one overload you parameterize with a IWin32Window handle (your Popup window) this should help you out showing your messagebox modal. greetz

            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