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 Icould use messagebox result?

how Icould use messagebox result?

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

    I have not messagebox result and I really want to use it. when I type it , it dosen't apear. I search and I find this public enum messageboxresult but I didn't khnow how to use it.

    D A Y K 5 Replies Last reply
    0
    • R ronakT

      I have not messagebox result and I really want to use it. when I type it , it dosen't apear. I search and I find this public enum messageboxresult but I didn't khnow how to use it.

      D Offline
      D Offline
      DaveAuld
      wrote on last edited by
      #2

      Here is an example of how to get the result from a message box.

      private void doSomething()
      {
      DialogResult theResult = MessageBox.Show("Is this working?", "Well.......",MessageBoxButtons.YesNo,MessageBoxIcon.Question);

      if (theResult == DialogResult.Yes)
      {
      //Go and do something here
      }
      }

      Dave Don't forget to rate messages!
      Find Me On: Web|Facebook|Twitter|LinkedIn
      Waving? dave.m.auld[at]googlewave.com

      X 1 Reply Last reply
      0
      • R ronakT

        I have not messagebox result and I really want to use it. when I type it , it dosen't apear. I search and I find this public enum messageboxresult but I didn't khnow how to use it.

        A Offline
        A Offline
        Abhinav S
        wrote on last edited by
        #3

        MessageBoxButton buttons = MessageBoxButton.OKCancel;
        MessageBoxImage icon = MessageBoxImage.Information;
        MessageBoxResult defaultResult = MessageBoxResult.OK;
        // Show message box
        MessageBoxResult result = MessageBox.Show(message, caption, buttons, icon, defaultResult);

        This is however available only in .Net framework 3 and above. See here.

        Quidquid latine dictum sit, altum videtur.
        Whatever is said in Latin sounds profound.

        1 Reply Last reply
        0
        • D DaveAuld

          Here is an example of how to get the result from a message box.

          private void doSomething()
          {
          DialogResult theResult = MessageBox.Show("Is this working?", "Well.......",MessageBoxButtons.YesNo,MessageBoxIcon.Question);

          if (theResult == DialogResult.Yes)
          {
          //Go and do something here
          }
          }

          Dave Don't forget to rate messages!
          Find Me On: Web|Facebook|Twitter|LinkedIn
          Waving? dave.m.auld[at]googlewave.com

          X Offline
          X Offline
          Xmen Real
          wrote on last edited by
          #4

          In yes or no, this can be use

          if (MessageBox.Show("Is this working?", "Well.......", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
          {
          }
          else // no
          {
          }

          TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN% R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i’TV.C\y<pŠjxsg-b$f4ia>

          ----------------------------------------------- 128 bit encrypted signature, crack if you can

          1 Reply Last reply
          0
          • R ronakT

            I have not messagebox result and I really want to use it. when I type it , it dosen't apear. I search and I find this public enum messageboxresult but I didn't khnow how to use it.

            Y Offline
            Y Offline
            yu jian
            wrote on last edited by
            #5
                        if (DialogResult.Yes == MessageBox.Show("test", "ask", MessageBoxButtons.YesNo, MessageBoxIcon.Information))
                        {
            
                        }
            
            1 Reply Last reply
            0
            • R ronakT

              I have not messagebox result and I really want to use it. when I type it , it dosen't apear. I search and I find this public enum messageboxresult but I didn't khnow how to use it.

              K Offline
              K Offline
              kumar169
              wrote on last edited by
              #6

              http://infynet.wordpress.com/2010/08/28/check-message-box-result hi check this link.

              1 Reply Last reply
              0
              • R ronakT

                I have not messagebox result and I really want to use it. when I type it , it dosen't apear. I search and I find this public enum messageboxresult but I didn't khnow how to use it.

                K Offline
                K Offline
                kumar169
                wrote on last edited by
                #7

                http://infynet.wordpress.com/2010/08/28/check-message-box-result hi check this link :laugh: :laugh:

                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