Form stuck while running a script

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 3 years and 1 week old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
AmministrazioneDCSAS
Posts: 3
Last visit: Wed Feb 21, 2024 6:52 am

Form stuck while running a script

Post by AmministrazioneDCSAS »

Hi everyone, I have a problem with a form, I created a button that installs a software that lasts 5 minutes, during this time, the form remains blocked, has it happened to someone?
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Form stuck while running a script

Post by jvierra »

This is normal Windows behavior. Blocking calls will always freeze the form until the call returns. The way out is to use a job for the blocking call and monitor the job for completion.

Look in the Info Center for how to use the JobTracker custom controlset to implement a job that keeps the form alive while the job executes.
This topic is 3 years and 1 week old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked