RichTextBox 中选择的矩形背景颜色
背景:
我将开始在当地大学的图书馆学习/编码。由于我不是学生,因此我无法使用他们的无线互联网接入。由于 StackOverflow 是一个非常好的资源,我希望能够随身携带它,因此我正在构建一个小型桌面应用程序来加载/搜索/显示最新的数据转储。
问题:
我想在与本网站相同的矩形块中显示代码块,因此我使用 RichTextBox 控件来尝试创建这种效果。不幸的是,当我想要的是达到选择的外部限制的矩形时,RichTextBox.SelectedBackColor 属性仅对实际文本进行着色。
示例:
这是我可以使用 RichTextBox 生成的内容:
这是我想要创建的:
问题:
- 有没有办法使用 RichTextBox 来产生这种效果?
- 如果没有,我可以使用其他控件来创建这种效果吗?
Background:
I'm going to start studying/coding at the local university's library. Since I'm not a student, I won't be able to utilize their wireless internet access. Since StackOverflow is such a great resource, I want to be able to take it with me, so I'm building a small desktop application to load/search/display the most recent data dumps.
Problem:
I want to display code blocks in the same sort of rectangular block as this site does, so I played with the RichTextBox control to try to create this effect. Unfortunately, the RichTextBox.SelectedBackColor property only colors the actual text, when what I want is a rectangle reaching to the outer limits of the selection.
Example:
This is what I am able to produce with the RichTextBox:
This is what I would like to create:
Questions:
- Is there any way to produce this effect using the RichTextBox?
- If not, are there any other controls I could use to create this effect?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不这么认为,MSDN。
I don't think so, there is no mention of controlling this behavior on MSDN.