LabWindows/CVI

Programming with Color Numeric Controls

This topic describes how to complete the following tasks programmatically.

Creating a Color Numeric Control

Use NewCtrl to create a color numeric control.

int colorNumeric;
colorNumeric = NewCtrl (panelHandle, CTRL_COLOR_NUMERIC, "Color Numeric Control", 30, 30);

Setting and Obtaining the Value of a Color Numeric Control

Use SetCtrlVal to set a color numeric control to a particular value.

SetCtrlVal (panelHandle, PANEL_COLORNUM, 0x000000L);

Use GetCtrlVal to obtain the current value of a color numeric control.

unsigned long colorVal;
GetCtrlVal (panelHandle, PANEL_COLORNUM, &colorVal);

Customizing the Appearance of a Color Numeric Control

Use SetCtrlAttribute to change the appearance of a color numeric control.

SetCtrlAttribute (panelHandle, PANEL_COLORNUM, ATTR_LABEL_COLOR, VAL_DK_GRAY);

SetCtrlAttribute (panelHandle, PANEL_COLORNUM, ATTR_LABEL_BOLD, 1);

SetCtrlAttribute (panelHandle, PANEL_COLORNUM, ATTR_LABEL_FONT, VAL_MESSAGE_BOX_FONT);

Related Topics

Programming with Controls

Color Numeric Control Functions