0

我需要从标签控件中获取文本的默认字体名称。(IE)

<asp:Label Text="Test" ID="lblq" runat="server"></asp:Label>

如何找到标签 'lblq' 的字体名称(或)字体系列?字体系列是否取决于浏览器?

我在下拉列表中加载了默认字体。当我单击一个按钮时,我只需要将标签“lblq”字体名称设置为下拉列表的选定值。

4

3 回答 3

1

尝试:-

string myVal = lblq.Font.Name;
于 2012-07-17T08:43:51.463 回答
0

this is not as relavent to your question but might give you a head start

            // this will give you the list of all installed fonts
             using System.Drawing.Text;

            InstalledFontCollection fontList = new InstalledFontCollection();  
            foreach(FontFamily family in fontList.Families)  
            {  
                ListBox1.Items.Add(family.Name);  
            }  
于 2012-07-17T08:46:49.550 回答
0

You can find original font name using following code:

string originalFontName=lblq.Font.OriginalFontName;
于 2012-07-17T08:47:34.663 回答