Hide label or button during execution

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 10 years and 11 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
marhal529
Posts: 1
Last visit: Fri Nov 08, 2013 4:29 am

Hide label or button during execution

Post by marhal529 »

Hi,
I need to hide a button and a lable in my project.
What I have done so far is to set the $<label namn>.visible to false and this doesn't work. Suggestions any one?
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Hide label or button during execution

Post by davidc »

Using the Visible property is the way to do it:
PowerShell Code
Double-click the code block to select all.
$button1.Visible = $false
$label1.Visible = $false
David
David
SAPIEN Technologies, Inc.
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Hide label or button during execution

Post by davidc »

I moved the post to the PowerShell GUIs forums, since this isn't a product specific question.

David
David
SAPIEN Technologies, Inc.
This topic is 10 years and 11 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