[RESOLVED] Message box that I didn't code appears.
:confused:
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
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.
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
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.
Re: Message box that I didn't code appears.
Quote:
Originally Posted by
si_the_geek
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.