gray out button based on user ID

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.
User avatar
Posts: 237
Meble kuchenne na zamówienie - na wymiar - Wrocław
Joined: Tue Feb 25, 2014 1:01 pm

gray out button based on user ID

Post by mqh777 »

Product: PowerShell Studio 2019 (64 Bit)
Build: v5.6.163
OS: Windows 10 Enterprise (64 Bit)
Build: v10.0.17763.0

How do you gray out a button based on user ID? I only want a handful of users to be able to press a certain button on a form.
Thank you.

Posts: 14447
Joined: Tue May 22, 2007 9:57 am

Re: gray out button based on user ID

Post by jvierra »

Just disable the button when the form loads based on a list of users OR … selectively enable buttons based on a user list.