简体   繁体   English

RichTextBox粗体等宽字体?

[英]RichTextBox bold monospace font?

I have a RichTextBox control on one of my forms, and I use a monospace font as it contains formatted text. 我在一种表单上具有RichTextBox控件,并且使用等宽字体,因为它包含格式化的文本。 I'm trying to implement a search functionality where you can search for specified text in the box, and it will display any text it finds matching your search query in bold. 我正在尝试实现搜索功能,您可以在框中搜索指定的文本,并且它将以粗体显示找到的与搜索查询匹配的任何文本。

Previously I was using Lucida Console which allowed me to bold it, but then that made the bold text wider than the rest of the text. 以前,我使用的是Lucida Console,它允许我将其加粗,但后来使加粗的文本比其余文本宽。 I've now tried switching to Courier New which doesn't change at all when I bold it. 我现在尝试切换到“ Courier New”,当我加粗它时根本不会改变。 Is there a monospace font out there that will let me bold it properly? 是否有等宽字体可以让我正确加粗?

I doubt it, especially if you want your program to run any all machines. 我对此表示怀疑,尤其是如果您希望程序运行所有计算机。 What do you mean courier New doesn't change when bold? 您的快递是什么意思,加粗时不会变新? It sure does here, although not very much. 它肯定会在这里做,尽管不是很多。

But as an alternative: Have you thought about changing the background colour, like vs does? 但作为替代方案:您是否考虑过像vs一样改变背景颜色?

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

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