4

I made this boolean array.

enter image description here

I want change the color of first boolean component as red, and second as blue.

enter image description here

This picture is what I want.

But when I change color property, three booleans change their color with together.

Is there any way to change color of boolean components, respectively?

KKS
  • 1,389
  • 1
  • 14
  • 33

2 Answers2

5

Short answer: Just replace the boolean with a color box, as shown in the links in the other reply. It will simply be an array of color boxes instead of an array of booleans.

Long answer: An Array control contains an inner element control. The only property that can differ between elements of the array is the Value property. All other properties are rendered identically across elements of the array. If you need to differentiate the elements based on something other than the Value, you need to either use a different control that renders the graphical aspect that you want as its Value (i.e. replacing the Boolean with a Color Box) or you need to break out the N elements that you want to display as N separate independent controls and manage the updating of the display by yourself through code on the block diagram. This generally means creating your own scrollbar control or numeric control for controlling the index of the array.

srm
  • 3,062
  • 16
  • 30
Yair
  • 2,266
  • 12
  • 12
1

You can always try to change your approach a little, try using clusters and if you need to use array, then create array of clusters. Here and here are similar subjects that should help you solving the problem with colors.

Slavo
  • 494
  • 4
  • 15
  • Thanks, I made the control, 8by8 array, already. At the first time, I didnt need color control, but on-off control... But, now I need color control. Changing control is little hard working now... I've already made many reference and local variables... But if i dont have any hope, i will use cluster. – KKS Oct 29 '15 at 09:50
  • If you made type of def, and you customised your control then in project tree you should be able to simply access and change it. When you change custom control, then it is like refractor it changes everywhere where you did use the control. – Slavo Oct 29 '15 at 09:53
  • Actually, you can consider using property nodes with this array and then doing some operation on particular array. Search for checking property of each element in array. – Slavo Oct 29 '15 at 12:47
  • 1
    Using property nodes to change the element inside the array won't help -- changing the properties of the inner control will update all the elements rendered. The array only has a single inner control that is rendered repeatedly for each displayed value of the array. – srm Oct 30 '15 at 01:03