December 19, 2014

Homework Help: visual basic

Posted by cl on Thursday, May 7, 2009 at 4:58pm.

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
' 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, _

End If

Answer this Question

First Name:
School Subject:

Related Questions

Visual Basic - what does IntTemp and IntRem mean? and whats wrong with my code, ...
Visual Basic - If you wanted your program to respond to an event every 5 seconds...
Visual Basic - I am working on a project called VB Auto Sales I am working in CH...
English - Hello. Please tell me if it's possible to say: 1) to declare a message...
Visual Basic - How do I display 1/2 as a signle character in a text box?
Programming (Visual Basic) - Im seem to be having trouble with this Exercise. ...
COM 215 written communication - I need to write an informative message,positive ...
Geometry - Greg made two similar glass display boxes shaped like triangular ...
visual basic net - Formula F=1.8 * C + 32 Create an application that displays a...
physics - A box and its contents have a total mass M = 9 kg. A string passes ...