Associate the LED color with the spin box
Control the color of the LED object by changing spin box values at runtime.
- In Project view, select LED1.
- In Properties, create a complex dynamic link with a Key-value converter between the Color and Value of SpinBox1:
-
In the complex dynamic link editor, next to Key-value converter, select
.
-
In the editor, next to Values, select String and select Color.
Tip: If you do not see the required option, select the Show all checkbox.
-
Add two rows by selecting
two times.
-
Set the values as follows:
Keys (UInt32) Values (Color) 0
#cd163f
1
#f58025
2
#00aeef
- In Project view, select SpinBox1.
-
In Properties, set Minimum value to 0.
Tip: Setting Minimum value prevents you from providing values that are not handled by Key-value converter at runtime.
-
In Properties, set Maximum value to 2.
Tip: Setting Maximum value prevents you from providing values that are not handled by Key-value converter at runtime.


