LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I put a red outline around a control when values are not out of range?

I understand that when you set the ATTR_MIN_VALUE and the ATTR_MAX_VALUE for a control that a red outline will occur when the value is out of range. Is it possible to have the red outline occur around a control for a different reason? If so, how would I make this happen?
Thanks,
Donna
0 Kudos
Message 1 of 4
(3,384 Views)
It is not possible to obtain the red outline for other than the out-of-range condition.

In case you want to mimic this effect, you can put a color numeric below the control sizing it larger then the control itself; in the code you can assign to the color numeric the desired color for different conditions.

Roberto


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 4
(3,384 Views)
You can also mimic this behavior with a decoration control. Select Classic Style Controls >> Decoration >> Raised Frame.

You can toggle the red outline by setting ATTR_VISIBLE on the decoration control or you can toggle the color of the frame between red and transparent.
0 Kudos
Message 3 of 4
(3,384 Views)
Hi Donna.

Rather than creating an additional control on your panel, you could try this:

// Get the control's initial frame color
GetCtrlAttribute (panelHandle, myControlId, ATTR_FRAME_COLOR, &normalColor);
...
...
// Set the control's frame color based on whatever condition
SetCtrlAttribute (panelHandle, myControlId, ATTR_FRAME_COLOR, needRedOutline? VAL_RED: normalColor);

Colin.
0 Kudos
Message 4 of 4
(3,384 Views)