I have 3 form ;
Form1 - Main Form
Form2 - Sub form ( contains progress bar and timer)
Form3 - Sub form with heavy contains which takes time for loading ( like parsing data from webpage and writing it to Datagridview at form load event)
I need to show form2 with a progress bar running while form3 is loading
I have following codes at Form1 ;
Me.Hide
Form2.Show()
Form3.Show()
codes from Form 2 ;
Public Class Form2
Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load
LoadingTimer.Enabled = True
End Sub
Private Sub LoadingTimer_Tick(sender As Object, e As EventArgs) Handles LoadingTimer.Tick
If MyProgressBar.Value <= MyProgressBar.Maximum - 1 Then
MyProgressBar.Value += 10
End If
If MyProgressBar.Value = 100 Then
LoadingTimer.Enabled = False
Me.Close()
End If
If Label1.ForeColor = Color.LimeGreen Then
Label1.ForeColor = Color.White
Else
Label1.ForeColor = Color.LimeGreen
End If
End Sub
End Class
The problem is progress bar starting but freezing at the beginning while Form3 is loading
Any idea for solution?