如何为粗体创建代码 [英] how to create a code for bold a line
本文介绍了如何为粗体创建代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在文本框中为一行粗体编写代码
I want to write a code for a bold the one line in text box
推荐答案
你不能 - 文本框不支持不同的字体或文字样式对于单独的行:任何文本修饰都适用于整个文本框。
您可以使用RichTextBox - 它支持字符上的字体和粗体(等)必要的字符基础。
错字:测试为文本 - OriginalGriff [/ edit]
You can't - text boxes do not support different font or text style for individual lines: any text embellishment applies to the whole text box.
You could use a RichTextBox though - that supports font and bold (etc.) on a character by character basis if necessary.
[edit]Typo: "Test" for "Text" - OriginalGriff[/edit]
据我所知,你无法在TextBox中更改单行字体。
你需要使用RichTextBox
例如。
As far as I know you cannot change a single lines font in a TextBox.
You would need to use a RichTextBox
eg.
Font f = new Font("Verdana",14,FontStyle.Bold);
richTextBox1.SelectionFont = f;
这篇关于如何为粗体创建代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文