Shiny Language Reference

Language Reference > User Interface > Memo Boxes


setmemoboxfont

setmemoboxfont(int ID, string Font, int Size, int RGBCol, bool Bold, bool Italic);

 

Sets the font used for the memo box text

The SETMEMOBOXFONT statement sets the font used for the text in a memo box.

Any change to the font is carried out immediately, and the control is redrawn to reflect the new font style. It is your responsibility to ensure the font chosen for a memo box fits inside the control itself. Setting a font too large for the memo box will cause all pixels outside of the memo box boundary to be clipped.

The font used for the memobox controls the number of visible lines/items. To fine-tune the position and clipping of text items in the control, refer to the setmemoboxtextrect statement.

Note that the setmemoboxfontcol statement is approximately 4 times faster than this statement 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

Font

The name of the font typeface

Size

The point size of the font

RGBCol

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

Bold

True if the caption text should be bold, otherwise False.

Italic

True if the caption text should be italic, otherwise False.

 

Return Value

None

 

Example Code

// Create the memo box X: 10, Y:10 and sized 150*70
int iMemoBoxID = creatememobox(1, 10, 10, 150, 70);

// Let's have a 10 point, bright blue Arial font
setmemoboxfont(iMemoBoxID, "Arial", 12, RGB(0, 0, 200), False, False);