C#.NET多行TextBox与宽度相同的字符 [英] C# .NET multiline TextBox with same-width characters

查看:125
本文介绍了C#.NET多行TextBox与宽度相同的字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎样才能使它所以如果你在多行文本框中键入

How can I make it so if you typed in a multiline textbox

ABCDE

&放大器;

ABCDE

所以,大E为直接的小E的下方。

So that the big E is directly below the little e.

我希望他们垂直对齐,如果它们是相同的行中的

I want them to line up vertically if they are in the same row.

此外,使用的WinForms

Also, using winforms

推荐答案

你能只设置字体的文本框到的等宽有一个

Can you just set the font on the textbox to a monospaced one?

在代码中,保持规模作为默认字体相同的:

In code, keeping the same size as the default font:

textBox.Font = new Font(FontFamily.GenericMonospace, textBox.Font.Size);

或只是更改了字体属性设计师。

Or just change the Font property in the designer.

这篇关于C#.NET多行TextBox与宽度相同的字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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