Shiny Language Reference

Language Reference > User Interface > Edit Boxes


seteditboxfont

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

 

Sets the font used for the edit box text

The SETEDITBOXFONT statement sets the font used for the text of an edit box previously created with createditbox.

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 an edit box fits inside the edit box itself. Setting a font too large for the edit box will cause all pixels outside of the edit box boundary to be clipped.

Note that the seteditboxfontcol 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 caption 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 a 50x20 editbox at 10, 10 and store it's ID
int Id = createeditbox(1, 10, 10, 50, 20);

// Set the edit box font to red, 10pt Times New Roman
Italic.
seteditboxfont(Id, "Times New Roman", 10, RGB(255, 0, 0), False, True);