Control set to run .exe and show progressbar/busy animation

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 5 years and 10 months 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
n1mdas
Posts: 22
Last visit: Sat Dec 05, 2020 2:51 pm

Control set to run .exe and show progressbar/busy animation

Post by n1mdas »

Hello,

I have some questions regarding Control sets within PowerShell Studio 2018.

I like the Control set: Button - Start Job. I like it as it will be suitable what I am looking for.

I am working on a portable application for x64/x86 OS Archicture. I want to accomplish the below tasks:

- the portable application will be shipped with 1x additional .exe file as a package;
Note: The separate *.exe can be run as a standalone *.exe file as well. I just need the dependency.
- when the user clicks on the button [ Start Job Control set used to have the busy animation shown ] there should be run the linked *.exe file, show an informative msgbox that the application is running. After the process is done with gathering logs to show another message where the data is located.

For the task I assume that I have to use the control set: Button - Run Process. Here I cannot "see" how to have the nice busy effect like when using the button - Start job.

I know how to show the msgboxes for those informative messages but how to accomplish at the same time to run a proccess/.exe file and show a busy animation or progress bar like for those two control sets?

Can you please point me to an example different from those that are defined within the Blog post that accomplishes this?
https://info.sapien.com/index.php/guis/ ... sive-forms

Thanks,
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Control set to run .exe and show progressbar/busy animation

Post by jvierra »

You cannot use a messagebox without freezing the UI. Just place a label on the form that says that the process is running and change it to "process completed" when the process is done.
User avatar
n1mdas
Posts: 22
Last visit: Sat Dec 05, 2020 2:51 pm

Re: Control set to run .exe and show progressbar/busy animation

Post by n1mdas »

Thanks for the hint:
You cannot use a message box without freezing the UI. Just place a label on the form that says that the process is running and change it to "process completed" when the process is done.
I will see how to implement this.

How to achieve the other things like described? Is it possible using the Start Job Control set with running an *.exe externally located in order to use the busy animation or it is not as per best practices?

Can you point me to some examples other then the Blog post where such idea i have is done in the best practices scenario?

Thank you.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Control set to run .exe and show progressbar/busy animation

Post by jvierra »

Start-Job is the best method to use. The blog posts are the best. You will need to have a very good basic understanding of PowerShell and Forms to understand the post and how to use the code.
This topic is 5 years and 10 months 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