I have built a form in PSS using the 'Process Tracker' control set. I have set the process to run, wait for 60 seconds, and then start over. The entire things works great. However, the 'stop process' button only seems to work while the process is actually running -- not during the 60 second wait timer.I have tinkered with adding an additional 'abort' button, putting the $buttonCancelProcess.Enabled variable in different places, and enabling the ControlBox. Nothing seems to work.Ideas?
mbaker2012-07-24 16:27:15
Forcing a form to close before process completes
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.
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.
-
- Posts: 107
- Last visit: Thu Apr 29, 2021 8:47 am
-
- Posts: 107
- Last visit: Thu Apr 29, 2021 8:47 am
Forcing a form to close before process completes
I have built a form in PSS using the 'Process Tracker' control set. I have set the process to run, wait for 60 seconds, and then start over. The entire things works great. However, the 'stop process' button only seems to work while the process is actually running -- not during the 60 second wait timer.I have tinkered with adding an additional 'abort' button, putting the $buttonCancelProcess.Enabled variable in different places, and enabling the ControlBox. Nothing seems to work.Ideas?
mbaker2012-07-24 16:27:15
mbaker2012-07-24 16:27:15
Mike
Forcing a form to close before process completes
Hard to tell what is happening without seeing the "stop process" button's click script block. If you are using the Process tracker control set, you can call the Stop-ProcessTracker function to stop all the running processing. If you want it to stop the processes when the form is closed you simply call the Stop-ProcessTracker function on the form's closed event: $formMain_FormClosed=[System.Windows.Forms.FormClosedEventHandler]{#Event Argument: $_ =
[System.Windows.Forms.FormClosedEventArgs] #Stop any pending
processes Stop-ProcessTracker} David
[System.Windows.Forms.FormClosedEventArgs] #Stop any pending
processes Stop-ProcessTracker} David
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
-
- Posts: 107
- Last visit: Thu Apr 29, 2021 8:47 am
Forcing a form to close before process completes
The progress bar isn't associated with the timer. The progress bar tracks the main process. Once that's done, the progress bar resets to a value of 0 and the timer starts. When it reaches 00, the main process starts again. This is all working fine.
What I need to be able to do is abort the script while the timer is still counting down. Seems that, while the timer is running, nothing else is clickable. I will try changing to the timer control. Maybe that will work better for me.
What I need to be able to do is abort the script while the timer is still counting down. Seems that, while the timer is running, nothing else is clickable. I will try changing to the timer control. Maybe that will work better for me.
Mike
Forcing a form to close before process completes
Just add the control and doubleclick on it. The event will be on the scren and place your short code ther. When ready for it to run just $timer1.enabled=$true.
Set the properties for the time interval you need.
Set the properties for the time interval you need.