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. how to close MessageBox automatically

how to close MessageBox automatically

Scheduled Pinned Locked Moved C#
tutorialquestion
6 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.
  • S Offline
    S Offline
    Sajjad Izadi
    wrote on last edited by
    #1

    Hi, I want my program to close a MessageBox automatically after x seconds, whether the user answers to MessageBox or not. How is that? thanks

    T R 2 Replies Last reply
    0
    • S Sajjad Izadi

      Hi, I want my program to close a MessageBox automatically after x seconds, whether the user answers to MessageBox or not. How is that? thanks

      T Offline
      T Offline
      Tom Deketelaere
      wrote on last edited by
      #2

      Write your own messagebox (just create a dialogform) Put a timer on it and close the form after x seconds has past. There might be a better way but this is how I would do it.

      S 1 Reply Last reply
      0
      • T Tom Deketelaere

        Write your own messagebox (just create a dialogform) Put a timer on it and close the form after x seconds has past. There might be a better way but this is how I would do it.

        S Offline
        S Offline
        Sajjad Izadi
        wrote on last edited by
        #3

        so how can i assign my icon to that as easy as MessageBoxIcon.Information or MessageBoxIcon.Error ... does? should i use my own PictureBox for it and make all fundamentals from the begining, or is there any other way that i use right that enum (MessageBoxIcon) instead?

        N T 2 Replies Last reply
        0
        • S Sajjad Izadi

          so how can i assign my icon to that as easy as MessageBoxIcon.Information or MessageBoxIcon.Error ... does? should i use my own PictureBox for it and make all fundamentals from the begining, or is there any other way that i use right that enum (MessageBoxIcon) instead?

          N Offline
          N Offline
          N a v a n e e t h
          wrote on last edited by
          #4

          AFAIK, you have to create your own form and use some methods to draw the icon on it. This form can return a DialogResult as message box does.

          Navaneeth How to use google | Ask smart questions

          1 Reply Last reply
          0
          • S Sajjad Izadi

            Hi, I want my program to close a MessageBox automatically after x seconds, whether the user answers to MessageBox or not. How is that? thanks

            R Offline
            R Offline
            Ravi Bhavnani
            wrote on last edited by
            #5

            See this[^] article. /ravi

            My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

            1 Reply Last reply
            0
            • S Sajjad Izadi

              so how can i assign my icon to that as easy as MessageBoxIcon.Information or MessageBoxIcon.Error ... does? should i use my own PictureBox for it and make all fundamentals from the begining, or is there any other way that i use right that enum (MessageBoxIcon) instead?

              T Offline
              T Offline
              Tom Deketelaere
              wrote on last edited by
              #6

              If you decide to create it yourself I recommend doing it from scratch. But the other reply has a link to a nice article that does exactly what you want.

              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