Skip to main content

TcxCustomFontNameComboBox.AddMRUFontName(TFontName) Method

Adds a new entry in the MRU font list.

Declaration

function AddMRUFontName(const AFontName: TFontName): TcxMRUFontNameAction;

Parameters

Name Type
AFontName TFontName

Returns

Type
TcxMRUFontNameAction

Remarks

Use the AddMRUFontName method to add a new name of the font into the MRU font list. If successful, the new item appears at the top of the control’s MRU font list area. If the Properties.MaxMRUFonts property value is 0 (there are no MRU fonts within the list), then this method does nothing.

The name of a font is added to the MRU font list when a user selects the font within the combo box. If the font’s name already exists in the MRU list, then the selected name is placed at the top of the MRU list. The same happens when the MRU list is populated completely (the number of fonts within it has reached the MaxMRUFonts property value) and a user selects another font within the combo box.

Parameter Meaning
AFontName The name of the font to add to the MRU font list.

The return value of this method is a TcxMRUFontNameAction enumerator value. See the enumerator description for details. Successful execution of this method raises the OnAddedMRUFont event.

The following code demonstrates adding Arial into the MRU list:

cxFontNameComboBox.AddMRUFontName('Arial');

Result of code execution is demonstrated below:

Before the AddMRUFontName method call After the AddMRUFontName method call
See Also