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 Form and Message Box

Windows Form and Message Box

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

    I have a windows form and the first thing I want to happen is for a MessageBox to ask a Yes/No question after the form loads. However, I want the form to fully render itself before the MessageBox pops up. If I put the MessageBox.Show in the form constructor or in the form's Load method, the MessageBox appears first thing and the form does not appear until the user answers the MessageBox. What do I need to do? Thanks, Mark Mokris

    P D L 3 Replies Last reply
    0
    • M MarkMokris

      I have a windows form and the first thing I want to happen is for a MessageBox to ask a Yes/No question after the form loads. However, I want the form to fully render itself before the MessageBox pops up. If I put the MessageBox.Show in the form constructor or in the form's Load method, the MessageBox appears first thing and the form does not appear until the user answers the MessageBox. What do I need to do? Thanks, Mark Mokris

      P Offline
      P Offline
      Peter Nirschl
      wrote on last edited by
      #2

      Hello, Maybe you could call the Form's Invalidate method before showing the messasge box. Peter

      1 Reply Last reply
      0
      • M MarkMokris

        I have a windows form and the first thing I want to happen is for a MessageBox to ask a Yes/No question after the form loads. However, I want the form to fully render itself before the MessageBox pops up. If I put the MessageBox.Show in the form constructor or in the form's Load method, the MessageBox appears first thing and the form does not appear until the user answers the MessageBox. What do I need to do? Thanks, Mark Mokris

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

        Is the form supposed to wait on the message box to do something? If not, you can create a thread to show the message box. This will assure that your app will paint itself in the background. Make sure the messagebox is on top though.

        1 Reply Last reply
        0
        • M MarkMokris

          I have a windows form and the first thing I want to happen is for a MessageBox to ask a Yes/No question after the form loads. However, I want the form to fully render itself before the MessageBox pops up. If I put the MessageBox.Show in the form constructor or in the form's Load method, the MessageBox appears first thing and the form does not appear until the user answers the MessageBox. What do I need to do? Thanks, Mark Mokris

          L Offline
          L Offline
          leppie
          wrote on last edited by
          #4

          override void OnLoad(EventArgs e)
          {
          base.OnLoad(e);
          //now call MsgBox.Show() :P
          }

          xacc-ide 0.0.10 now with C#, MSIL, C and HLSL coloring - Screenshots

          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