How can I make it so if you typed in a multiline textbox
abcde
&
ABCDE
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.
Also, using winforms
How can I make it so if you typed in a multiline textbox
abcde
&
ABCDE
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.
Also, using winforms
You can do this by using a fixed width font. Courier family fonts are often fixed width.
You can set the font in the property editor for the textbox control. For example, you can st the Font property to Courier New, 8.25pt.
Try using a monospaced or fixed width fonts.
Can you just set the font on the textbox to a monospaced one?
In code, keeping the same size as the default font:
Or just change the
Font
property in the designer.Some fonts use different character widths for different characters. In such fonts an "m" will have a greater width than an "i". They are called proportional fonts. These fonts have a nicer-looking and are easier to read.
Fonts where all the characters have the same width are called monospaced fonts. They are often used for source code as they allow aligning features like line comments to right of the code.
Use a monospaced font!
Here is the code I use to get a list of all monospaced fonts installed: