Hi,
How do I run a form that has a progress bar on a separate thread from another form?
Thanks
Add following code in second Form (say Form2) in which ProgressBar control was added.
Public Class Form2
Private Sub Form2_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Dim tst As New Action(AddressOf Test)
ProgressBar1.BeginInvoke(tst)
End Sub
Sub Test()
For i As Integer = 1 To 100
ProgressBar1.Value = i
Threading.Thread.Sleep(100)
ProgressBar1.Refresh()
Next
End Sub
End Class
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.