如何在RichTextBox的C#对准“文字? [英] How to 'align' text in RichTextBox C#?

查看:174
本文介绍了如何在RichTextBox的C#对准“文字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何对齐文本中的一个RichTextBox?

How do I align the text in a RichTextBox?

基本上,RTB包括:

- 测试

- 测试

测试 -

测试 -

哪个都具有相同的字符数,但是具有不同的比对。我该如何调整他们正常吗?林相当新的C#和困惑,因为它在Java中的文本区正确对齐。

Which all have the same number of characters, but have different alignments. How can I align them properly? Im fairly new to C# and confused since it aligned properly in Java's TextArea.

感谢您!

推荐答案

您将不得不字体更改为等宽字体,如快递。这种行为,你正在展示是标准的大多数字体,因为不是所有的字符都是相同的宽度。

You would have to change the font to a monospaced font, like Courier. This behavior you're showing is standard with most fonts, as not all characters are the same width.

这篇关于如何在RichTextBox的C#对准“文字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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