如何显示字符串为粗体? [英] how to display a string to be bold?

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

问题描述

我宣布了一个字符串

字符串s =每月建模

我希望这在输出中显示粗体格式。怎么办?

谢谢你

I declared a string
string s = "Monthly Modeling"
I want this to display Bold format in the output..How to do?
thank u

推荐答案

设置用于显示项目的必要设置。例如:如果在文本框中显示,则设置文本框属性,使其字体以粗体显示。
Set the necessary setting of the item you are using to display it. Eg: if displaying in a text box, set the text box property so that it's font is displayed in bold.


如果您使用的是窗口应用程序,那么您将使用标签来显示文本只需将标签的Bold属性设置为true即可。



if you are using a window application then you will use a label to display the text so simply set the Bold property of the label to true.

this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));





如果您使用的是网络应用程序,那么只需将标签附加到您喜欢的字符串上





if you are using web application then simply append tag with your string like this

string s = "<b>Monthly Modeling</b>";


这篇关于如何显示字符串为粗体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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