Unable to cancel form while it's running

This topic contains 1 reply, has 2 voices, and was last updated by  Will Prather 5 days, 6 hours ago.

  • Author
  • #95856


    I have a PowersShell form that has a start button with a few functions:


    While the script is calling the functions in the background, I am unable to interact with GUI. More specifically, I am unable to click on the cancel button to cancel/exit the script at anytime. The only time I can cancel the form is when it is completely finished running all the functions. Are there any ways to keep my start button active and cancel my form at any time?

  • #95859

    Will Prather

    What you are looking for is a multi-threaded application. There's some ways of doing that, see link below.

    Stephen Owen wrote the above blog. It's really useful in describing how to use multiple runspaces in your application. I won't lie though, even after reading the blog, it took me a little while to fully grasp the concept and apply it myself.

You must be logged in to reply to this topic.