Click here to Skip to main content
15,886,519 members
Articles / Programming Languages / C#
Tip/Trick

Adding fonts to Infragistics WebHtmlEditor

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
23 Mar 2011CPOL 9.5K  
Adding fonts to Infragistics WebHtmlEditor
We can add the fonts to the fonts dropdown in addition to the existing basic fonts. To add 'Times New Roman' to the font names drop down-
C#
ToolbarDropDown ddlFonts = (ToolbarDropDown)infraEditor.FindByKeyOrAction("FontName");
ddlFonts.Items.Add(new ToolbarDropDownItem("Times New Roman","Times New Roman"));

Similarly to add all the windows registered fonts-
C#
ToolbarDropDown ddlFonts = (ToolbarDropDown)infraEditor.FindByKeyOrAction("FontName");
InstalledFontCollection fonts = new InstalledFontCollection();
foreach (FontFamily family in fonts.Families)
{
    ddlFonts.Items.Add(new ToolbarDropDownItem(family.Name,family.Name));
}

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Technical Lead
India India
Hi, I am Narsimlu Keshagouni working as Technical Lead in Hyderabad, India.

Comments and Discussions

 
-- There are no messages in this forum --