troubleshooting Question

VB.NET Question

Avatar of FalconTwo
FalconTwo asked on
Visual Basic.NET
11 Comments1 Solution378 ViewsLast Modified:
Working on another assignment and ran into a snag. I am writing the code and testing each routine. When I compile and test and I unable to close the error window

What am I doing wrong

Option Strict On 'Enforces strict data typing
Public Class frmHockeyStats
    Dim strName As String
    Dim intSeason, intGoals, intAssist As Integer

    Private Sub btnGetStats_Click(ByVal sender As Object, _
                                  ByVal e As System.EventArgs) _
                              Handles btnGetStats.Click

        'Accept and Validate Name box is not empty
        Do While True
            ' strName = Me.txtName.Text
            If String.IsNullOrEmpty(strName) = True Then
                MessageBox.Show("Name must be provided", "Error", _
                            MessageBoxButtons.OK, MessageBoxIcon.Error)
            Else
                Exit Do
            End If
        Loop

        'Accept and Validate Season
        Do While True
            If Integer.TryParse(Me.txtSeasons.Text, intSeason) = False Then
                MessageBox.Show("Season Must be a Number", "Error", _
                                MessageBoxButtons.OK, MessageBoxIcon.Error)
                Me.txtSeasons.Focus()
                Me.txtSeasons.SelectAll()
            Else

            End If
            If intSeason > 0 AndAlso intSeason <= 20 Then
                btnGetStats.Enabled = True
            Else
                Exit Do
            End If
        Loop
    End Sub

    '------------------------------------------------------------------------
    'btnExit Click Event Procedure.
    '1. Closes the form.
    '
    'Parameters:
    ' Standard (IDE-supplied)
    '
    'Calling procedure (example):
    ' When user clicks on "Exit" button (btnExit)
    '------------------------------------------------------------------------

    Private Sub btnExit_Click(ByVal sender As System.Object, _
                              ByVal e As System.EventArgs) _
                              Handles btnExit.Click
        Me.Close()
    End Sub

    'btnClear Click Event Procedure.
    ' When the Clear button is selected, the values are cleared
    Private Sub btnClear_Click(ByVal sender As System.Object, _
                               ByVal e As System.EventArgs) _
                                Handles btnClear.Click
        txtName.Text = ""
        txtSeasons.Text = ""
        txtGoals.Text = ""
        txtAssist.Text = ""
        lstSeason.Items.Clear()
    End Sub
End Class
ASKER CERTIFIED SOLUTION
adriankohws

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 11 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 11 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros