简体   繁体   English

如何使用TextBrick粗体创建某些文本

[英]How to make certain text in a TextBrick bold

I have used textbrick to display my Text. 我用textbrick来显示我的文字。 I want to show certain part of the text bold. 我想以粗体显示文本的某些部分。 Is that possible? 那可能吗?

For example: 例如:

TextBrick tb = new TextBrick();
tb.Rect = new RectangleF(0, 0, e.Graph.ClientPageSize.Width, 100);
tb.Text="Profile Name : "+lblProfile.Text;

I want to make 'Profile Name' bold. 我想把'Profile Name'加粗。

您只需设置Font属性

tb.Font = new Font(tb.Font, FontStyle.Bold);

I suggest to use the RichTextBrick instead of the TextBrick. 我建议使用RichTextBrick而不是TextBrick。 Note that you need to provide RTF formated text. 请注意,您需要提供RTF格式化文本。 One of the approaches discussed here 这里讨论的方法之一

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM