ASPxClientCommandConsts.FONTCOLOR_COMMAND Property
In This Article
Identifies a command that changes the color of a fore color pickers and sets the selected text fore color.
#Declaration
TypeScript
static FONTCOLOR_COMMAND: string
#Property Value
Type | Description |
---|---|
string | Value: “forecolor” |
#Remarks
The FONTCOLOR_COMMAND property can be used in the following ways.
- In the ASPxClientHtmlEditor.CommandExecuted event — to determine the toolbar or ribbon item clicked by an end-user. If the ASPxClientHtmlEditorCommandEventArgs.commandName event parameter returns the FONTCOLOR_COMMAND property value, this means that either the ToolbarFontColorButton toolbar item or the HEFontColorRibbonCommand ribbon item (depending upon the toolbar mode used) has been manipulated by an end-user.
In the ASPxClientHtmlEditor.ExecuteCommand method — to execute the command manually.
In this case, the method requires an additional parameter, which is a string representing a color (in any correct format) to be assigned to the fore color pickers (ToolbarFontColorButton, HEFontColorRibbonCommand) and the selected text. You can also execute the method without a parameter to apply the color currently chosen in the fore color pickers to the selected text without changing it.
//sets the color of the ToolbarFontColorButtonand the selected text fore color to red htmlEditor.ExecuteCommand(ASPxClientCommandConsts.FONTCOLOR_COMMAND, '#ff0000');
Note
This command is available only in the Design View.
See Also