Font style to dropdownlist asp.net
I am trying to display all the fonts available in the system with its own style. But it is not working. I am following for color it is working fine.
Problem: This code is working fine in firefox but not in IE. Is there any option to make it work.
Code:
foreach (FontFamily font in fonts.Families)
{
ddlFontName.Items.Add(font.Name); // Working
}
for (int row = 0; row < ddlFontName.Items.Count; row++)
{
ddlFontName.Items[row].Attributes.Add("style", 开发者_StackOverflow中文版"font-family:" + ddlFontName.Items[row].Value); // Not Working
}
The default drop down list did not have this capability on every line. Not even the default windows drop down list can do that as it is with out custom render.
To make what you try, you need to make a custom menu, that is looks like drop down list.
In this menou that you make it out of div/ui/li set, you place inside the render style you like, make your selection then save your selection to an input.
Its a big javascript journey...
Take this as example: http://www.marghoobsuleman.com/jquery-image-dropdown
精彩评论