How to: Set up a custom font dialog

  • 6 minutes to read

This sample is based upon the ideas from sample Implementing custom commands and dialogs. It illustrates how to replace the default ToolbarParagraphFormattingEdit, ToolbarFontNameEdit and ToolbarFontSizeEdit buttons of your ASPxHtmlEditor by a single nice-looking dialog.

View Example

using System;

namespace HtmlEditorCustomFontDialog.UserControls {
    public partial class CustomFontDialog : System.Web.UI.UserControl {
        protected void Page_Load(object sender, EventArgs e) {
            pcCustomFontDialog.PopupElementID = HtmlEditorID;
            hf["HtmlEditorID"] = HtmlEditorID;
            hf["PopupID"] = pcCustomFontDialog.ClientID;
        }

        public string HtmlEditorID {
            get { return (string)ViewState["HtmlEditorID"]; }
            set { ViewState["HtmlEditorID"] = value; }
        }
    }
}