|
-
Nov 30th, 2015, 10:29 AM
#1
Thread Starter
Lively Member
[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
-
Nov 30th, 2015, 10:35 AM
#2
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
-
Nov 30th, 2015, 10:35 AM
#3
Re: Message box that I didn't code appears.
Take a closer look at this line, which contains two message boxes:
 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.
-
Nov 30th, 2015, 10:39 AM
#4
Thread Starter
Lively Member
Re: Message box that I didn't code appears.
 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.
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|