我如何将字体大小和字符串字体更改为Bold. [英] How i can change font size and font of string to Bold .

查看:80
本文介绍了我如何将字体大小和字符串字体更改为Bold.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何将字体的大小和字符串的字体更改为粗体,并附加到stringBuilder


例如:

字符串strname ="welcome"
stringBuilder strsb =新的stringBuilder();

strsb.append(strname);


我想将欢迎文本字体大小更改为18Px,
并大胆

怎么可能.

如果有知道,我会感激的.

谢谢与问候

Venkat

How i can change font size and font of string to Bold and i attached to stringBuilder


EX:

string strname="welcome"
stringBuilder strsb=new stringBuilder();

strsb.append(strname);


i want to change welcome text font size to 18Px,
and to Bold

how it is possible.

If any Know i appreciate .

Thanks&Regards

Venkat

推荐答案

您无需更改字符串本身.相反,您可以更改显示字符串的控件.

You don''t change the string itself. Instead, you change the control that''s displaying the string.

Label1.Text = myString;
Label1.Font = new Font(Label1.Font.Name, 18, Label1.Font.Style & FontStyle.Bold, Label1.Font.Unit);



请记住,在WPF/Silverlight中执行此操作将有所不同.



Keep in mind that doing this in WPF/Silverlight will be different.



请参考此链接.
http://stackoverflow.com/questions/5039543/change-font-of- a-string-in-c [ ^ ]
Hi,
Please refer this link.
http://stackoverflow.com/questions/5039543/change-font-of-a-string-in-c[^]


这篇关于我如何将字体大小和字符串字体更改为Bold.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆