In the btnRun_click add this line:
In order to correctly catch the Exited event Set EnableRaisingEvents back to trueCode:btnRun.Enabled = False
Code:Private Sub CMD_Exited(ByVal sender As Object, ByVal e As EventArgs) btnRun.Enabled = True ' < --- Add THis 'Me.Close() <- This is what caused the form to close. If you leave this commented the form won't close txtConsoleOut.AppendText(Text & "All done!!!") txtConsoleOut.ScrollToCaret() End Sub




Reply With Quote