OK, so dass mein Akku jetzt ist das Hinzufügen und ordnungsgemäß in Form als Gesamt zeigt. Allerdings ist etwas falsch in meinem if ... then Aussage und es ist nicht auf die 2. Ebene zu werfen nach dem Erreichen der 125 I 125 treffen kann, und ich brauche, um einen Eintrag zu machen, um meine Tasten bekommen zu aktivieren. Jede Hilfe wird geschätzt!Mein Speicher und Berechnungen funktionieren nicht in VB 2010
* Bearbeiten mit der Do While-Schleife aktualisiert zu zeigen. Nun Probleme mit meinem Eingabefehler msgbox verursacht ... *
do while decTotalCredits < 125
If IsNumeric(txtCredit.Text) Then
' This statement will convert the string entered to decimal and establish the
' input as the decCredit Variable
decCredit = Convert.ToDecimal(txtCredit.Text)
' This Case Statement is to verify that the correct denominations of coins are
' being entered in the machine.
Select Case decCredit
Case 5, 10, 25, 100
' This line adds the newly entered credit to the
' exsisting total
decTotalCredits += decCredit
lblTotal.Text = Convert.ToString(decTotalCredits)
lblTotal.Visible = True
' reset the text input box for the credit amount
txtCredit.Clear()
txtCredit.Focus()
Case Else
' This message will appear if a Credit is entered that does not
' conform to normal coins
MsgBox("Please enter a valid coin amount", , "Invalid Amount Entered")
End Select
Else
' This message will occur when a user inputs a non-numeric entry
MsgBox("Please enter a valid Coin amount", , "Input Error")
End If
Loop
' Loop should complete when credits hit 125 and activate this code
' Once the credits are reached the prompt to make selection is visible.
lblMakeSelection.Visible = True
' Once the credits are reached, the buttons for selection become enabled.
btnDietPepsi.Enabled = True
btnPepsi.Enabled = True
btnSierraMist.Enabled = True
btnLemonade.Enabled = True
btnDrPepper.Enabled = True
btnWater.Enabled = True
End Sub
Sie überprüfen die gesamten Kredite, bevor Sie die aktuellen Kredite hinzuzufügen. – Ryan
Danke ... ich das Original auf eine Do IF-Anweisung geändert haben While-Schleife ... mich jetzt Fehler mit meinem msgbox die geben ... sie auftauchen und nicht Eingabe neuer Daten erlauben ... Es ist die „INPUT FEHLER "Das gibt mir die Mühe –
Warum ist es in einer Schleife? Das funktioniert jetzt garantiert nicht mehr ... – Ryan