I recently had to make a dropdownlist populated with fonts. Luckily, .NET allows you to use the installed fonts very easy.
First, add a drowdownlist to your ASP.NET page like this:
private void BindFontsToDropdownlist()
{
InstalledFontCollection col = new InstalledFontCollection();
foreach (System.Drawing.FontFamily family in col.Families)
{
ddlFonts.Items.Add(family.Name);
}
}
That's all there is to it. Be aware that the fonts are the ones installed on
the server hosting your web page.
Friday, January 4, 2008
Bind Fonts to a dropdownlist in c#
Labels:
ASP.NET
Subscribe to:
Post Comments (Atom)


No comments:
Post a Comment