Back to Devexpress

ToolbarJustifyCenterButton Class

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

latest4.2 KB
Original Source

ToolbarJustifyCenterButton Class

A default toolbar button that allows a paragraph whose content is selected in the design view area to be centered.

Namespace : DevExpress.Web.ASPxHtmlEditor

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

NuGet Package : DevExpress.Web

Declaration

csharp
public class ToolbarJustifyCenterButton :
    HtmlEditorToolbarItem
vb
Public Class ToolbarJustifyCenterButton
    Inherits HtmlEditorToolbarItem

Remarks

The ASPxHtmlEditor provides alignment formatting for the selected editor’s paragraph by using the Align Left (ToolbarJustifyLeftButton), Align Right (ToolbarJustifyRightButton), Align Center ( ToolbarJustifyCenterButton ) and Justify (ToolbarJustifyFullButton) buttons.

You can add these buttons 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();
    ToolbarJustifyLeftButton ljButton = new ToolbarJustifyLeftButton();
    ToolbarJustifyRightButton rjButton = new ToolbarJustifyRightButton();
    ToolbarJustifyCenterButton cjButton = new ToolbarJustifyCenterButton();
    ToolbarJustifyFullButton fjButton = new ToolbarJustifyFullButton();
    stToolbar1.Items.Add(ljButton);
    stToolbar1.Items.Add(rjButton);
    stToolbar1.Items.Add(cjButton);
    stToolbar1.Items.Add(fjButton);
    ASPxHtmlEditor1.Toolbars.Add(stToolbar1);
}
aspx
<dx:ASPxHtmlEditor ID="ASPxHtmlEditor1" runat="server">
    <Toolbars>
        <dx:HtmlEditorToolbar Name="StandardToolbar1">
            <Items>
                <dx:ToolbarJustifyLeftButton>
                </dx:ToolbarJustifyLeftButton>
                <dx:ToolbarJustifyCenterButton>
                </dx:ToolbarJustifyCenterButton>
                <dx:ToolbarJustifyRightButton>
                </dx:ToolbarJustifyRightButton>
                <dx:ToolbarJustifyFullButton>
                </dx:ToolbarJustifyFullButton>
            </Items>
        </dx:HtmlEditorToolbar>
    </Toolbars>
</dx:ASPxHtmlEditor>

Implements

IStateManager

IPropertiesOwner

IExpressionsAccessor

Inheritance

Object StateManager CollectionItem ToolbarItemBase HtmlEditorToolbarItem ToolbarJustifyCenterButton

See Also

ToolbarJustifyCenterButton Members

HTML Editor

Default Toolbar Items

Menu Toolbar Items

Html Editor Designer

DevExpress.Web.ASPxHtmlEditor Namespace