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.
Locked
User avatar
mqh777
Posts: 237
Joined: Tue Feb 25, 2014 1:01 pm

gray out button based on user ID

Post by mqh777 » Wed Jun 12, 2019 12:58 pm

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.

jvierra
Posts: 13891
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: gray out button based on user ID

Post by jvierra » Wed Jun 12, 2019 1:58 pm

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

Locked