1+1=2
1+2=3
1+3=4
1+4=5
1+5=6
1+6=7
1+7=8
1+8=9
1+9=10
1+10=11
1+11=12
1+12=13
I don't understand how to get that information into a list box
I am also stuck in an infinite loop somehow i think because nothing shows up at all in the listbox and the number the user enters should at least be there. I am assuming the code should be more like
lstbox.items.add(decNumEntered("+1 =")
could someone point to what i am missing or some psuedocode maybe? Thanks
[Option Strict On
[Option Explicit On
[Public Class frmMathTutor
['Initialize and define variables
[Dim strNumEntered As String
[ Dim decNumEntered As Decimal
[Dim strInputMessage As String = "Enter a number between 0 and 12"
[Dim strInputHeading As String = "Number"
[Dim strNormalMess As String = "Enter a number between 0 and 12"
[Dim strNumError As String = "Error - You did not enter a number between 0 and 12."
[Dim decAnswer As Decimal
[Dim decMax As Decimal = 13
[Dim decMin As Decimal = 0
[Dim strCancelClicked As String = ""
[Private Sub frmMathTutor_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
[End Sub
[Private Sub mnuExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuExit.Click
Close()
[End Sub
[Private Sub mnuClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuClear.Click
lstEquations.Items.Clear()
btnEnter.Enabled = True
mnuAddition.Checked = False
mnuMultiplication.Checked = True
[End Sub
[Private Sub mnuAddition_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuAddition.Click
mnuAddition.Checked = True
mnuMultiplication.Checked = False
[End Sub
[Private Sub mnuMultiplication_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles [mnuMultiplication.Click
[mnuMultiplication.Checked = True
[mnuAddition.Checked = False
[ End Sub
[ Private Sub btnEnter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEnter.Click
[ strNumEntered = InputBox(strInputMessage, strInputHeading, "")
[ Do While decNumEntered < decMax Or decNumEntered >= decMin Or strNumEntered = strCancelClicked
[ If IsNumeric(strNumEntered) Then
[ decNumEntered = Convert.ToDecimal(strNumEntered)
[ If decNumEntered > 0 Then
[ lstEquations.Items.Add(decNumEntered)
[
[ strInputMessage = strNormalMess
[ Else
[ strInputMessage = strNumError
[ End If
[ End If
[ Loop
[ End Sub
End Class]
This post has been edited by modi123_1: 27 April 2012 - 01:01 PM
Reason for edit:: highlight the lines THEN click the code tags

New Topic/Question
Reply



MultiQuote





|