Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

argumentoutofrangeexception was unhandled

$
0
0
please help me ... i am doing when i press the button then the other form will show ..but when i run my program it show this argumentoutofrangeexception was unhandled and its pointing in progressbar1.value = a

Public Class Form1
    Dim a As Integer
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        a = 0

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Timer1.Start()
    End Sub
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        a = a + 10
        ProgressBar1.Value = a
        ' ProgressBar1.Increment(1)
        Label2.Text = "Loading " & a & " %"
        If ProgressBar1.Value = 100 Then
            MsgBox(" Loading IS Complete")
            Me.Hide()
            Form2.Show()
            a = 0
            Timer1.Enabled = False
        End If

    End Sub
End Class

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>