Progress bar cannot be shown while a process is running

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi there,
There is a problem about progress bar; although the
"progressbar1.visible = True" is present for my invisible
"progressbar1" control to make visible when button1 is clicked, before
execution of my external process, it appears after the external
process finishes processing. And my main and only form (form1) cannot
be interacted while external process is processing. How can i get rid
of it?

Here is the code:

Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

progressbar1.visible = True

Dim psInfo As New System.Diagnostics.ProcessStartInfo("c:\blabla.exe)
psInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal
Dim myProcess As Process = System.Diagnostics.Process.Start(psInfo)
myProcess.WaitForExit()
MsgBox(" Completed Successfully", MsgBoxStyle.Information,
"Completed")

End Sub


Thanks and regards...

.


Quantcast