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. Visual Basic
  4. Message box results....

Message box results....

Scheduled Pinned Locked Moved Visual Basic
tutorialquestion
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.
  • J Offline
    J Offline
    Joey Picerno
    wrote on last edited by
    #1

    How do I control a messageboxes results? I know of the msgboxresult.yes/no/ok etc. But I am missing something because when I use this no matter what the result is it still runs the same code when it shouldnt. If someone could please give me a quick example on how to use messageboxes and have different things happen depending on the msgboxresult I would really appreciate it. Thank you...

    N V T 3 Replies Last reply
    0
    • J Joey Picerno

      How do I control a messageboxes results? I know of the msgboxresult.yes/no/ok etc. But I am missing something because when I use this no matter what the result is it still runs the same code when it shouldnt. If someone could please give me a quick example on how to use messageboxes and have different things happen depending on the msgboxresult I would really appreciate it. Thank you...

      N Offline
      N Offline
      nlarson11
      wrote on last edited by
      #2

      Are you using Msgboxresult by itself or comparing what msgbox is returning? If MsgBox("place question here", MsgBoxStyle.OkCancel) = MsgBoxResult.Cancel Then End If

      1 Reply Last reply
      0
      • J Joey Picerno

        How do I control a messageboxes results? I know of the msgboxresult.yes/no/ok etc. But I am missing something because when I use this no matter what the result is it still runs the same code when it shouldnt. If someone could please give me a quick example on how to use messageboxes and have different things happen depending on the msgboxresult I would really appreciate it. Thank you...

        V Offline
        V Offline
        Vimalsoft Pty Ltd
        wrote on last edited by
        #3

        you can try this

        If MessageBox.Show("Do you want Exit?", "titleBar", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then
        'quiting the Application
        Else
        'Dont Quit
        End If

        Vuyiswa Maseko

        1 Reply Last reply
        0
        • J Joey Picerno

          How do I control a messageboxes results? I know of the msgboxresult.yes/no/ok etc. But I am missing something because when I use this no matter what the result is it still runs the same code when it shouldnt. If someone could please give me a quick example on how to use messageboxes and have different things happen depending on the msgboxresult I would really appreciate it. Thank you...

          T Offline
          T Offline
          TomGarth
          wrote on last edited by
          #4

          Dim msgResult As MsgBoxResult = MsgBox("Do you want to SAVE this record?", MsgBoxStyle.YesNoCancel, "DATA HAS CHANGED") Select Case msgResult Case MsgBoxResult.Yes ' Save Data Case MsgBoxResult.No ' Clear the form Case MsgBoxResult.Cancel ' Do nothing End Select

          Tom Garth Developer R. L. Nelson and Associates, Inc., Virginia

          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