Back to Devexpress

ToolbarFontSizeEdit Class

aspnet-devexpress-dot-web-dot-aspxhtmleditor-7308bd98.md

latest5.1 KB
Original Source

ToolbarFontSizeEdit Class

A default toolbar editor that allows the font size to be selected and applied to the text content 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 ToolbarFontSizeEdit :
    ToolbarComboBoxBase
vb
Public Class ToolbarFontSizeEdit
    Inherits ToolbarComboBoxBase

Remarks

The ASPxHtmlEditor allows end-users to change the font size of the editor’s selected text by using the Font Size combo box ( ToolbarFontSizeEdit ). Clicking the combo box button, opens a drop down window with predefined font sizes.

You can add the Font Size 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.CreateStandardToolbar2();
    ToolbarFontSizeEdit fsButton = new ToolbarFontSizeEdit();
    ToolbarListEditItem item1 = new ToolbarListEditItem();
    item1.Text = "1 (8pt)";
    item1.Value = "1";
    ToolbarListEditItem item2 = new ToolbarListEditItem();
    item2.Text = "2 (10pt)";
    item2.Value = "2";
    ToolbarListEditItem item3 = new ToolbarListEditItem();
    item3.Text = "3 (12pt)";
    item3.Value = "3";
    ToolbarListEditItem item4 = new ToolbarListEditItem();
    item4.Text = "4 (14pt)";
    item4.Value = "4";
    ToolbarListEditItem item5 = new ToolbarListEditItem();
    item5.Text = "5 (18pt)";
    item5.Value = "5";
    ToolbarListEditItem item6 = new ToolbarListEditItem();
    item6.Text = "6 (24pt)";
    item6.Value = "6";
    ToolbarListEditItem item7 = new ToolbarListEditItem();
    item7.Text = "7 (36pt)";
    item7.Value = "7";
    fsButton.Items.Add(item1);
    fsButton.Items.Add(item2);
    fsButton.Items.Add(item3);
    fsButton.Items.Add(item4);
    fsButton.Items.Add(item5);
    fsButton.Items.Add(item6);
    fsButton.Items.Add(item7);
    stToolbar1.Items.Add(fsButton);
    ASPxHtmlEditor1.Toolbars.Add(stToolbar1);
}
aspx
<dx:ASPxHtmlEditor ID="ASPxHtmlEditor1" runat="server">
    <Toolbars>
        <dx:HtmlEditorToolbar Name="StandardToolbar2">
            <Items>
                <dx:ToolbarFontSizeEdit>
                    <Items>
                        <dx:ToolbarListEditItem Text="1 (8pt)" Value="1" />
                        <dx:ToolbarListEditItem Text="2 (10pt)" Value="2" />
                        <dx:ToolbarListEditItem Text="3 (12pt)" Value="3" />
                        <dx:ToolbarListEditItem Text="4 (14pt)" Value="4" />
                        <dx:ToolbarListEditItem Text="5 (18pt)" Value="5" />
                        <dx:ToolbarListEditItem Text="6 (24pt)" Value="6" />
                        <dx:ToolbarListEditItem Text="7 (36pt)" Value="7" />
                    </Items>
                </dx:ToolbarFontSizeEdit>
            </Items>
        </dx:HtmlEditorToolbar>
    </Toolbars>
</dx:ASPxHtmlEditor>

Implements

IStateManager

IPropertiesOwner

IExpressionsAccessor

Inheritance

Object StateManager CollectionItem ToolbarItemBase HtmlEditorToolbarItem ToolbarDropDownBase ToolbarComboBoxBase ToolbarFontSizeEdit

See Also

ToolbarFontSizeEdit Members

HTML Editor

Default Toolbar Items

Menu Toolbar Items

Html Editor Designer

DevExpress.Web.ASPxHtmlEditor Namespace