Hide button

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
mqh77777
Posts: 252
Last visit: Mon Feb 26, 2024 10:07 am
Has voted: 1 time

Hide button

Post by mqh77777 »

PowerShell Studio 2018 v5.5.150

I know I can use logic like this to hide a button. if ($user1 -like '*JoeUser*' ){ Start-Sleep -m 1 } Else { $tabpage1.Enabled = $false}
But is it possible to have a Button disabled until a TextBox has text? We want users to enter text into a textbox field and then press a Submit button. But if they enter nothing we want the Submit button to be grayed out. Can PowerShell studio do that?
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Hide button

Post by jvierra »

That is what the "Validated" event is for. Validate in "Validating" event and enable the button in the "Validated" event.
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