Showing the message box twice problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lotus18
    Contributor
    • Nov 2007
    • 865

    Showing the message box twice problem

    Hello World!

    I have this code:

    [CODE= vbnet]Private Sub mnuItemExit_Cli ck(ByVal sender As Object, ByVal e As EventArgs) Handles mnuItemExit.Cli ck
    If MessageBox.Show ("Are you sure you want to exit system?", "Exit System", MessageBoxButto ns.YesNo, MessageBoxIcon. Question) = Windows.Forms.D ialogResult.Yes Then
    Global.System.W indows.Forms.Ap plication.Exit( )
    End If
    End Sub[/CODE]

    How can I prevent it to show it twice everytime I clicked the Yes button?

    Rey Sean
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    EDIT:
    Hmm, I have no idea why it would show your messagebox twice?
    Have you put a breakpoint in there and stepped through the code to see the path the code takes? It might tell you why/how you are getting the message twice.

    Comment

    • lotus18
      Contributor
      • Nov 2007
      • 865

      #3
      Originally posted by Plater
      EDIT:
      Hmm, I have no idea why it would show your messagebox twice?
      Have you put a breakpoint in there and stepped through the code to see the path the code takes? It might tell you why/how you are getting the message twice.
      Ahh.. OK. Atlast I solved the problem. I just reviewed the codes and delete the unnecessary lines.

      Rey Sean

      Comment

      Working...