I pass progressbar byref to the processing() function on ClassLibrary. My main form freezes when i run this.
How can i prevent my main form by freezing? My Function is always on the class library, so is there any way or any
type of approach to this problem. I need the progressbar to be accurate in showing the process. Please Help.Thanks.
Main Form Code
Class Library Code
How can i prevent my main form by freezing? My Function is always on the class library, so is there any way or any
type of approach to this problem. I need the progressbar to be accurate in showing the process. Please Help.Thanks.
Main Form Code
VB.NET:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim lib1 As New ClassLibrary1.Class1()
lib1.processing(ProgressBar1)
End Sub
Class Library Code
VB.NET:
Public Class Class1
Public Sub processing(ByRef progBar As Windows.Forms.ProgressBar)
progBar.Minimum = 0
progBar.Maximum = 1000000
For i As Integer = 0 To 1000000
progBar.Value = i
Next
End Sub
End Class