aspnet-devexpress-dot-web-dot-aspxhtmleditor-9a3737e0.md
A default toolbar editor that allows the named font to be selected and applied to the text content selected in the design view area.
Namespace : DevExpress.Web.ASPxHtmlEditor
Assembly : DevExpress.Web.ASPxHtmlEditor.v25.2.dll
NuGet Package : DevExpress.Web
public class ToolbarFontNameEdit :
ToolbarComboBoxBase
Public Class ToolbarFontNameEdit
Inherits ToolbarComboBoxBase
The ASPxHtmlEditor allows end-users to change the font type of the editor’s selected text by using the Font Name button. Clicking this button opens a drop down window with predefined font types.
You can add the Font Name button to toolbars by using either the ASPxHtmlEditor designer at design time, or programmatically.
protected void Page_Load(object sender, EventArgs e) {
HtmlEditorToolbar stToolbar1 = HtmlEditorToolbar.CreateStandardToolbar1();
ToolbarFontNameEdit fontName = new ToolbarFontNameEdit();
ToolbarListEditItem item1 = new ToolbarListEditItem();
item1.Text = "Times New Roman";
item1.Value = "Times New Roman";
ToolbarListEditItem item2 = new ToolbarListEditItem();
item2.Text = "Tahoma";
item2.Value = "Tahoma";
ToolbarListEditItem item3 = new ToolbarListEditItem();
item3.Text = "Verdana";
item3.Value = "Verdana";
ToolbarListEditItem item4 = new ToolbarListEditItem();
item4.Text = "Arial";
item4.Value = "Arial";
ToolbarListEditItem item5 = new ToolbarListEditItem();
item5.Text = "MS Sans Serif";
item5.Value = "MS Sans Serif";
ToolbarListEditItem item6 = new ToolbarListEditItem();
item6.Text = "Courier";
item6.Value = "Courier";
fontName.Items.Add(item1);
fontName.Items.Add(item2);
fontName.Items.Add(item3);
fontName.Items.Add(item4);
fontName.Items.Add(item5);
fontName.Items.Add(item6);
stToolbar1.Items.Add(fontName);
ASPxHtmlEditor1.Toolbars.Add(stToolbar1);
}
<dx:ASPxHtmlEditor ID="ASPxHtmlEditor1" runat="server">
<Toolbars>
<dx:HtmlEditorToolbar Name="StandardToolbar1">
<Items>
<dx:ToolbarFontNameEdit>
<Items>
<dx:ToolbarListEditItem Text="Times New Roman" Value="Times New Roman" />
<dx:ToolbarListEditItem Text="Tahoma" Value="Tahoma" />
<dx:ToolbarListEditItem Text="Verdana" Value="Verdana" />
<dx:ToolbarListEditItem Text="Arial" Value="Arial" />
<dx:ToolbarListEditItem Text="MS Sans Serif" Value="MS Sans Serif" />
<dx:ToolbarListEditItem Text="Courier" Value="Courier" />
</Items>
</dx:ToolbarFontNameEdit>
</Items>
</dx:HtmlEditorToolbar>
</Toolbars>
</dx:ASPxHtmlEditor>
Object StateManager CollectionItem ToolbarItemBase HtmlEditorToolbarItem ToolbarDropDownBase ToolbarComboBoxBase ToolbarFontNameEdit
See Also