Menu Toolbar
- 3 minutes to read
Menu toolbars are displayed in the ASPxHtmlEditor when the ASPxHtmlEditor.ToolbarMode property is set to Menu.
ASPxHtmlEditor stores menu toolbars in its ASPxHtmlEditor.Toolbars collection, which is represented by an instance of the HtmlEditorToolbarCollection class, and allows individual toolbars to be added, deleted and accessed using an indexer notation or their names.
Individual menu toolbar objects are represented by descendants of the HtmlEditorToolbar class. A toolbar’s visibility and visible order relative to the other toolbars can be controlled by using the HtmlEditorToolbar.Visible and HtmlEditorToolbar.VisibleIndex properties, respectively. To define a toolbar’s unique identifier name, which can be used to obtain the toolbar at runtime, use the HtmlEditorToolbar.Name property.
Each menu toolbar implements the HtmlEditorToolbar.Items collection that can contain a set of toolbar items (default or custom).
You can modify toolbar and item collections at design time using the ASPxHtmlEditor Designer.
Default Toolbars
ASPxHtmlEditor provides the following default toolbars that contain predefined sets of default toolbar items, grouped by specific functionality.
The StandardToolbar1 contains default toolbar items (listed below) that provide quick shortcuts to many frequently used operations. To create this toolbar in code, call the HtmlEditorToolbar.CreateStandardToolbar1 function.
- Cut (ToolbarCutButton)
- Copy (ToolbarCopyButton)
- Paste (ToolbarPasteButton)
- Paste from Word (ToolbarPasteFromWordButton)
- Undo (ToolbarUndoButton)
- Redo (ToolbarRedoButton)
- Remove Format (ToolbarRemoveFormatButton)
- Superscript (ToolbarSuperscriptButton)
- Subscript (ToolbarSubscriptButton)
- Ordered List (ToolbarInsertOrderedListButton)
- Bullet list (ToolbarInsertUnorderedListButton)
- Insert Link (ToolbarInsertLinkDialogButton)
- Unlink (ToolbarUnlinkButton)
- Insert Image (ToolbarInsertImageDialogButton)
- Table Operations (ToolbarTableOperationsDropDownButton)
- Full Screen (ToolbarFullscreenButton)
The StandardToolbar2 contains default toolbar items (listed below) that help end-users perform the main text formatting operations. To create this toolbar in code, call the HtmlEditorToolbar.CreateStandardToolbar2 function.
- Paragraph (ToolbarParagraphFormattingEdit)
- Font Name (ToolbarFontNameEdit)
- Font Size (ToolbarFontSizeEdit)
- Bold (ToolbarBoldButton)
- Italic (ToolbarItalicButton)
- Underline (ToolbarUnderlineButton)
- Strikethrough (ToolbarStrikethroughButton)
- Align Left (ToolbarJustifyLeftButton)
- Align Center (ToolbarJustifyCenterButton)
- Align Right (ToolbarJustifyRightButton)
- Back Color (ToolbarBackColorButton)
- Fore Color (ToolbarFontColorButton)
To quickly add both standard toolbars to this collection at runtime, call the ASPxHtmlEditor.CreateDefaultToolbars method.
The TableToolbar contains a set of default toolbar items (listed below) that provide table-support functionality. To create this toolbar in code, call the HtmlEditorToolbar.CreateTableToolbar function.
- Insert Table (ToolbarInsertTableDialogButton)
- Table Properties (ToolbarTablePropertiesDialogButton)
- Row Properties (ToolbarTableRowPropertiesDialogButton)
- Column Properties (ToolbarTableColumnPropertiesDialogButton)
- Cell Properties (ToolbarTableCellPropertiesDialogButton)
- Insert Row Above (ToolbarInsertTableRowAboveButton)
- Insert Row Below (ToolbarInsertTableRowBelowButton)
- Insert Column to the Left (ToolbarInsertTableColumnToLeftButton)
- Insert Column to the Right (ToolbarInsertTableColumnToRightButton)
- Split Horizontally (ToolbarSplitTableCellHorizontallyButton)
- Split Vertically (ToolbarSplitTableCellVerticallyButton)
- Merge Right (ToolbarMergeTableCellRightButton)
- Merge Down (ToolbarMergeTableCellDownButton)
- Delete Table (ToolbarDeleteTableButton)
- Delete Row (ToolbarDeleteTableRowButton)
- Delete Column (ToolbarDeleteTableColumnButton)
Custom toolbars
The ASPxHtmlEditor allows you to create custom toolbars, which can contain custom or default toolbar items. Represented by the HtmlEditorToolbar class instances, custom toolbars implement ordinary toolbar functionality.
Note
View the Example How to: Create custom toolbar items