简体   繁体   中英

How to make certain text in a TextBrick bold

I have used textbrick to display my Text. 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.

您只需设置Font属性

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

I suggest to use the RichTextBrick instead of the TextBrick. Note that you need to provide RTF formated text. One of the approaches discussed here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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