Clicks on button
- Sbagen process (An open source software) runs at background.
Label2.Text = "Running"- Sbagen process ends automatically after the job done.
- Now this is the place I want to edit. I want my software change
Label2.Textto"Finished"right after "Sbagen" process ends. How can I achieve this? Tried endless things.
SOLUTION:
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
...
AddHandler timer_watcher.Tick, AddressOf TimerEvent
timer_watcher.Interval = TimeSpan.FromSeconds(1).TotalMilliseconds
timer_watcher.Start()
End If
End Sub
Public Sub TimerEvent(sender As Object, e As EventArgs)
Dim p() As Process = System.Diagnostics.Process.GetProcessesByName("sbagen")
If p.Length = 0 Then
timer_watcher.Stop()
Label2.Text = "Çevrildi!"
End If
End Sub
Aucun commentaire:
Enregistrer un commentaire