dcsimg
Results 1 to 4 of 4

Thread: [RESOLVED] Message box that I didn't code appears.

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2015
    Location
    Wilmington,NC
    Posts
    72

    Resolved [RESOLVED] Message box that I didn't code appears.


    this is in event handler submit order.
    I have debugged and used code-breaks to determine that this is they only handler that shows the problem.
    I receive my message box that confirms and shows order total THEN i receive a message box that has said "true","6" or "false" the unknown box also has the same title as all my others. after the confirmation of order is displayed I'm supposed to see another confirmation that order has been submitted. I do see that, but the unknown text box is in the middle. I have no clue why.
    Code:
     Private Sub btnSubmit_Click(sender As Object, e As EventArgs) Handles btnSubmit.Click
    
            
    
             If    (txtName.Text.Trim = "") Then
                MsgBox("Please enter your name.", MsgBoxStyle.Information, "P.T's Grill")
                txtName.Clear()
                txtName.Focus()
            Else
                MsgBox(MessageBox.Show(String.Format("Order total: {0}", lblTotalCost.Text.Trim), "P.T.'s Grille ", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) = DialogResult.Yes)
                radBlackBean.Checked = False
                radBLT.Checked = False
                txtName.Text = ""
                radBurgerEight.Checked = False
                radBurgerFour.Checked = False
                radCarryOut.Checked = False
                radChiken.Checked = False
                radDew.Checked = False
                radDiet.Checked = False
                radDog.Checked = False
                radMist.Checked = False
                radRB.Checked = False
                radRoastBeef.Checked = False
                radPepsi.Checked = False
                radSweet.Checked = False
                radUnsweet.Checked = False
                radWater.Checked = False
                radDiet.Checked = False
                radBlackBean.Checked = False
                radBLT.Checked = False
                radTurkey.Checked = False
                radPatio.Checked = False
                radVeggie.Checked = False
                lblTotalCost.Text = ""
                chkAmerican.Checked = False
                chkBacon.Checked = False
                chkChili.Checked = False
                chkJack.Checked = False
                chkKet.Checked = False
                chkLet.Checked = False
                chkMayo.Checked = False
                chkMust.Checked = False
                chkOnion.Checked = False
                chkTom.Checked = False
                radLemon.Checked = False
                radBurgerEight.Checked = False
                MsgBox("Your order has been submitted to the kitchen", MsgBoxStyle.OkOnly, "P.T.'s Grille")
            End If
    
    
    
    
    
    
    
    
    
        End Sub
    thanks in advance guys and input is appreciated
    again I'm in 2013 VB

  2. #2
    Still learning kebo's Avatar
    Join Date
    Apr 2004
    Location
    Gardnerville,nv
    Posts
    3,707

    Re: Message box that I didn't code appears.

    Believe it or not, you mostly likely did code the message box. These thing don't just randomly appear. When you you see the rouge message box, before dismissing it, pause the debugger. The code will either break at the line that you have called it, or it will break elsewhere. If it breaks elsewhere, it is being show on a back ground thread in which case you will have more work to do.
    Process control doesn't give you good quality, it gives you consistent quality.
    Good quality comes from consistently doing the right things.

    Vague general questions have vague general answers.
    A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.

    ______________________________
    Last edited by kebo : Now. Reason: superfluous typo's

  3. #3
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,265

    Re: Message box that I didn't code appears.

    Take a closer look at this line, which contains two message boxes:
    Quote Originally Posted by ItsBryanTho View Post
    Code:
                MsgBox(MessageBox.Show(String.Format("Order total: {0}", lblTotalCost.Text.Trim), "P.T.'s Grille ", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) = DialogResult.Yes)
    The commands MsgBox and MessageBox.Show are basically the same thing... in this case the MessageBox.Show shows the "Order total:" bit, and the MsgBox shows whether the return value of that MessageBox.Show is DialogResult.Yes or not.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Nov 2015
    Location
    Wilmington,NC
    Posts
    72

    Re: Message box that I didn't code appears.

    Quote Originally Posted by si_the_geek View Post
    Take a closer look at this line, which contains two message boxes:

    The commands MsgBox and MessageBox.Show are basically the same thing... in this case the MessageBox.Show shows the "Order total:" bit, and the MsgBox shows whether the return value of that MessageBox.Show is DialogResult.Yes or not.
    idk what I was thinking...Thanks I just ran it and that was it.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width