如何查找标签文本当前字体大小? [英] How to find label text current font size?
本文介绍了如何查找标签文本当前字体大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
朋友们......
我有一个标签。我想找到标签字体大小。我在这里使用
int i = labelid.font.size;
但它没有显示任何错误,也没有显示字体大小。请帮帮我。
谢谢和问候
Krishna
hi friends...
i have a label. i want to find that label font size. here i am using
int i=labelid.font.size;
but it not showing any error and also not showing the font size. please help me frnds.
Thanks and Regards
Krishna
推荐答案
我已将标签的尺寸(在properties-> Font->尺寸下)设置为'large',下面的代码给出了预期的尺寸
尺寸在ASP.net中的字体下将具有从'XX-small'到'XX-Large'的值
I have set the size of my label(under properties->Font->size) as 'large' and the code below gives the size as expected
Size under Font in ASP.net will have values from 'XX-small' to 'XX-Large'
string fontSize =Label1.Font.Size.ToString();
在.aspx页面上创建标签
Create a Label on .aspx page
<form id="form1" runat="server">
<asp:label id="Label1" runat="server" text="First Name" font-size="XX-Large" xmlns:asp="#unknown"></asp:label>
</form>
on .cs page
on .cs page
protected void Page_Load(object sender, EventArgs e)
{
FontSize fontSize = Label1.Font.Size.Type;
string size = fontSize.ToString();
Response.Write(size);
}
HI
i已发布此内容,如果你面对发表评论任何问题。
如何获取字体当前大小 [ ^ ]
这篇关于如何查找标签文本当前字体大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文