C#中RichTextBox文本居中显示
时间: 2023-10-19 08:23:58 浏览: 272
你可以使用RichTextBox的SelectionAlignment属性来设置文本的对齐方式,从而实现文本的居中显示。具体的代码如下:
```
richTextBox1.SelectionAlignment = HorizontalAlignment.Center;
```
其中,richTextBox1是你的RichTextBox控件的名称,HorizontalAlignment.Center表示将文本水平居中显示。
阅读全文
相关推荐

















