Ike-One
10-20-2006, 01:28 PM
I'm suppose do this:
"Write a Do While loop that uses an input box to ask the user to enter a number. The loop should keep runnning total of the numbers entered and stop when the total is greater than 300."
This is the code I have to work with:
Public Class lblList
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim strInput As String
If lstMonths.SelectedIndex = -1 Then
MessageBox.Show("Select a month")
ElseIf lstYears.SelectedIndex = -1 Then
MessageBox.Show("Select a year")
Else
strInput = lstMonths.SelectedItem.ToString() & " " _
& lstYears.SelectedItem.ToString()
MessageBox.Show("You selected" & strInput)
End If
End Sub
End Class
I would post this in the homework section, but given the circumstances of the subject... yeah.
"Write a Do While loop that uses an input box to ask the user to enter a number. The loop should keep runnning total of the numbers entered and stop when the total is greater than 300."
This is the code I have to work with:
Public Class lblList
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim strInput As String
If lstMonths.SelectedIndex = -1 Then
MessageBox.Show("Select a month")
ElseIf lstYears.SelectedIndex = -1 Then
MessageBox.Show("Select a year")
Else
strInput = lstMonths.SelectedItem.ToString() & " " _
& lstYears.SelectedItem.ToString()
MessageBox.Show("You selected" & strInput)
End If
End Sub
End Class
I would post this in the homework section, but given the circumstances of the subject... yeah.