LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Table colors turn to black after changing the control mode.

Hello,
 
I have a table in my project with three columns for red, green and blue. In my initialisation code, I give these three columns these colors, using SetTableCellRangeAttribute, with the attribute ATTR_TEXT_COLOR. At a certain point in my program (the user has to enter a password) I change the table's control mode from VAL_INDICATOR to VAL_HOT, so he can adjust the table cell values.
At the point where the control mode is changed, all colors revert to black! Of course I can get around this problem by inserting some part of my initialisation code again, but I am wondering why the red, green and blue disappear. Is this a CVI bug? Or does it happen for a certain reason?
I attached a small dummy project to this message, showing how the colors disappear...
 
Greetings,
Wim
0 Kudos
Message 1 of 4
(3,243 Views)
I wouldn't be surprised if this is normal. When you create a string field in the uir-editor and then change the control mode from HOT to VALIDATE you'll see it goes from white to gray...
Message 2 of 4
(3,237 Views)
Han is correct. This is by design.

Most controls have different default colors when they are in indicator mode as they do in other modes. Therefore, if (and only if) your panel is in "Conform to system colors" mode, these controls will have their default colors reapplied whenever you change to or from indicator mode, in the same way as if you had just turned on the ATTR_CONFORM_TO_SYSTEM panel attribute.

If you don't want this behavior, and you don't create new controls programmatically after your panel is loaded, I think you can simply turn off ATTR_CONFORM_TO_SYSTEM after loading the panel (since once the panel is loaded, it's really no longer needed). This way, the controls won't reset their colors when you change the mode.

Luis
NI
Message 3 of 4
(3,227 Views)
Thanks a lot Luis Smiley Very Happy
0 Kudos
Message 4 of 4
(3,210 Views)