Can you access/control button properties via script?

I’m looking to see if I can create a pin to lockout controls by having a transparent button overlay the controls. Then when the user clicks the button, they will be prompted for a pin, if successful, I was going to hide the button so they have access to the controls (I would make the button visible again via a menu or something). Just trying to figure out how I can control the properties of a button via a script. Thanks!

Yes, you can access most control properties in a script. All you need to do is assign a name to that control. Some of the default templates change control properties in a script. For example, LightDetails.xaml updates the visibility of a few controls in the page Loaded event.

Thanks Bill! That did the trick. I was going to create a pin for several buttons but realized it was going to get really complicated trying to do a script for all of them. So, I came up with a simple compromise. Just have a transparent button overlay the stuff I’m restricting and entering a correct password will hide the overlay making the buttons accessible. Then I added a button to the dashboard that, when selected will re-engage the overlay. Works like a charm!