Shiny Language Reference

Language Reference > User Interface > List Boxes


setlistboxfontcol

setlistboxfontcol(int ID, int RGBCol);

 

Sets the colour of the font used for the list box

The SETLISTBOXFONTCOL statement sets the RGB colour of the font used for the text of a list box.

Any change to the font is carried out immediately, and the control is redrawn to reflect the new font style.

Note that this statement is approximately 4 times faster than setlistboxfont if the only requirement is to change the RGB colour of the font.

 

Parameters

ID

The control ID of the control you wish to change the style of

RGBCol

An integer representing a packed RGB colour value (refer to the RGB statement) specifying the colour of the text

 

Return Value

None

 

Example Code

// Create the edit box X: 10, Y:10 and sized 200*120
int iListBoxID = createlistbox(1, 10, 10, 200, 120);

// Use a 10 point, bright blue Arial font
setlistboxfont(iListBoxID, "Arial", 10, RGB(0, 0, 200), False, False);

// Set the list box font to red
setlistboxfontcol(iListBoxID, RGB(255, 0, 0));