Cant get my message dialog box to display anbody see waht wrong with it? The message box is located in my if then else statement

Dim total As Integer = 0
Dim gradeCounter As Integer = 0
Dim grade As Integer = 0
Dim average As Double = 0

' sum grades in ListBox
Do
' read grade from ListBox
grade = gradesListBoxItemsItem(gradeCounter)
total += grade ' add grade to total
gradeCounter += 1 ' increment counter

Loop Until gradeCounter = gradesListBoxItemsCount()

average = total / gradesListBoxItemsCount() ' calculate average
averageResultLabel.Text = String.Format("{0:F}", average)
addButtonEnabled = True ' enable Add Grade Button
gradeTextBoxFocus() ' reset focus to Enter grade: TextBox

If (gradeCounter = " ") Then
MessageBoxShow( _
"There are not any grades entered", _
"Average can not be divided by zero", MessageBoxButtonsOK, _
MessageBoxIconError)
Else

End If

2 answers

gradeCounter is defined as Integer.
Try:
If(gradeCounter = 0)...
In VB, you should use OPTION EXPLICIT whenever possible in order to let the 'compiler' endorce strong typing.
Similar Questions
  1. Hello.Please tell me if it's possible to say: 1) to declare a message; 2) to announce a message; 3) to sound a message; 4) to
    1. answers icon 2 answers
  2. Which of the following would be considered an urgent message?​​​​​​A message from a new client A message requesting
    1. answers icon 1 answer
    1. answers icon 2 answers
  3. Communication has been successful when theA. message has been understood. B. message has been transmitted. C. message has been
    1. answers icon 1 answer
more similar questions