Change Label Color By Script
This applies to: Managed Dashboards, Managed Reports
This article shows you how to change a label or another component's background color using script. For example, you may want to change the color of the background of a component when it is clicked or hovered over.
Setting Up
In this example, we have a label component.
It has the following Look properties, with a background color of #F2F2F2.
Adding the Script
If you want to change the label when an action is performed, add the following script to a list in the Properties window's Actions section, such as Click:
label1.background = new dundas.controls.SolidColorBrush(new dundas.controls.Color(0xFFAAAA));
This uses the following API properties and classes:
Once this is added, you can choose Sandbox View in the toolbar to test the script.
For more information, see:
Comments
0 comments
Please sign in to leave a comment.