powershell-studio

Disabled button still triggers Click event

这一生的挚爱 提交于 2020-07-09 06:01:22
问题 I'm tring to prevent users to rapidly spam-click a button, which would freeze the app possibly for minutes while the code is being executed many times. $searchBtn_clicked = { $searchBtn.Enabled = $false ... some code that fills a listview from search result $searchBtn.Enabled = $true } My problem is: the code above will be executed as many times as the button is clicked, no matter what. Disabling the button after a click changes nothing. I also tried adding a start-sleep 2 before Enabling it

PowerShell Studio dynamic checkbox naming issue

对着背影说爱祢 提交于 2019-12-11 15:09:32
问题 giving the following PowerShell Studio Code, how can I call and disable the 'David Checkbox' under the 'Checkit' button. I know I am messing up on the checkbox declaration somehow because powershell does not recognize my checkbox as an object: The property 'Enabled' cannot be found on this object. Verify that the property exists and can be set. $accounts = "David", "Dave" $buttonLoadLabels_Click = { $CheckBoxCounter = 1 $accounts = 'didier','david' foreach ($account in $accounts) { $label =