LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't change frame color of text box!

The following command makes an ERROR
SetCtrlAttribute (panel_handle, SERIAL_STATUS, ATTR_FILL_COLOR, VAL_RED);
ERROR:
NON-FATAL RUN-TIME ERROR: "f:\LVS_CVI_SWupdate\serial.c", line 120, col 5, thread id 0x0000079C: Library function error (return value == -46 [0xffffffd2]). The attribute passed is not valid
please help me
0 Kudos
Message 1 of 2
(3,069 Views)
ATTR_FILL_COLOR is not the right attribute to use for the frame color of a textbox. You need to use ATTR_FRAME_COLOR.

Also, you don't specify whether you are using a lab-style textbox (CTRL_TEXT_BOX_LS) or classic-style textbox (CTRL_TEXT_BOX). You can only change the frame of the latter. The former uses a transparent frame, so the color comes from the panel.

Finally, as an FYI, if you use CVI 6.0 or later, you can press on an attribute name, and you will get a list of all control types for which that attribute is valid. You can also follow the link to the control to find out all the attributes that are valid for a particular control.

Luis
NI
0 Kudos
Message 2 of 2
(3,069 Views)