Form: disable button while scheduled task is running

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 1 year and 7 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
stevens
Posts: 493
Last visit: Mon Sep 19, 2022 12:23 am
Has voted: 2 times

Form: disable button while scheduled task is running

Post by stevens »

Hi,

Please advise howto (in a form) disable a button while a scheduled is running. Once the scheduled task is running, a grid will be refreshed in the form and also the button will be enabled again.
Idea is that the form is not frozen, but the button can only be pressed again when the scheduled task was done.

Thanks!
S
User avatar
brittneyr
Site Admin
Posts: 1649
Last visit: Mon Mar 18, 2024 1:47 pm
Answers: 38
Been upvoted: 30 times

Re: Form: disable button while scheduled task is running

Post by brittneyr »

[Topic was moved by moderator to PowerShell GUIs forum]
Brittney
SAPIEN Technologies, Inc.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Form: disable button while scheduled task is running

Post by jvierra »

The following links will explain how to use button controls.

https://info.sapien.com/index.php/guis/ ... on-control
https://docs.microsoft.com/en-us/dotnet ... esktop-6.0

Right clicking on any control in the toolbox will give you the link to the MS documentation for the control.
This topic is 1 year and 7 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