I want to:
- Show a form with a textbox.
- Run an external program (notepad.exe for ease of example).
- Continue to allow the user to enter data into the form textbox whilst notepad is running.
- Run some more (continue) native form code when notepad closes. This will update the form, amongst other things.
I'm having problems making this happen. I'm aware of a multitude of posts about this similar issue, but haven't found a solution that works for me.
I have tried:
- Doing a waitforexit, but this of course blocks the UI and users cannot enter data.
- Attempting an asynchronous process call, where another method is called when this process is completed. This causes a problem where the new method is called from another thread and can't update the form.
- Doing a wait/sleep loop in the UI, but again this will naturally block the UI.
What would be the neatest, and simplest solution for a simple Windows Form program? There are no extra classes used, and all code is in the Form1 class.