Back to Devexpress

ToolbarFontColorButton Class

aspnet-devexpress-dot-web-dot-aspxhtmleditor-c765b1c3.md

latest4.1 KB
Original Source

ToolbarFontColorButton Class

A default toolbar button that allows the required color to be applied to the text selected within the design view area.

Namespace : DevExpress.Web.ASPxHtmlEditor

Assembly : DevExpress.Web.ASPxHtmlEditor.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public class ToolbarFontColorButton :
    ToolbarColorButtonBase
vb
Public Class ToolbarFontColorButton
    Inherits ToolbarColorButtonBase

Remarks

The ASPxHtmlEditor allows end-users to change the font color of the editor’s selected text by using the Fore Color button ( ToolbarFontColorButton ). Clicking the Fore Color button opens a drop down window with predefined colors.

You can fill the drop down window with custom colors using the ToolbarColorButtonBase.Items property.

If the button ToolbarColorButtonBase.EnableCustomColors property is set to true, end-users can select a custom color using the color picker.

You can add the Fore Color button to toolbars by using either the ASPxHtmlEditor designer at design time, or programmatically.

csharp
protected void Page_Load(object sender, EventArgs e) {
    HtmlEditorToolbar stToolbar1 = HtmlEditorToolbar.CreateStandardToolbar1();
    ToolbarFontColorButton foreColor = new ToolbarFontColorButton();
    stToolbar1.Items.Add(foreColor);
    ASPxHtmlEditor1.Toolbars.Add(stToolbar1);
}
aspx
<dx:ASPxHtmlEditor ID="ASPxHtmlEditor1" runat="server">
    <Toolbars>
        <dx:HtmlEditorToolbar Name="StandardToolbar1">
            <Items>
                <dx:ToolbarFontColorButton>
                </dx:ToolbarFontColorButton>
            </Items>
        </dx:HtmlEditorToolbar>
    </Toolbars>
</dx:ASPxHtmlEditor>

Implements

IStateManager

IPropertiesOwner

IExpressionsAccessor

Inheritance

Object StateManager CollectionItem ToolbarItemBase HtmlEditorToolbarItem ToolbarDropDownBase ToolbarColorButtonBase ToolbarFontColorButton

See Also

ToolbarFontColorButton Members

HTML Editor

Default Toolbar Items

Menu Toolbar Items

Html Editor Designer

DevExpress.Web.ASPxHtmlEditor Namespace