Alignment problem displaying .txt file in window's textbox?

G

Guest

Hi everyone,

I try to a display a .txt file in window's textbox or rich textbox. The
text file has contents line by line aligned perfectly when using NotePad to
view and print it. But when I display this .txt file in textbox or rich
textbox the alignment all messed up. Please help me to solve this problem.

Thanks in advance.

Nina
 
G

Guest

Nina,

Be sure you are using a fixed-pitch font like Courier-New and not a
proportional font for the textbox or rich textbox.

Also be sure the textbox is wide enough to display an entire line without
wordwrapping.

Kerry Moorman
 
L

Larry Lard

Nina said:
Hi everyone,

I try to a display a .txt file in window's textbox or rich textbox. The
text file has contents line by line aligned perfectly when using NotePad to
view and print it. But when I display this .txt file in textbox or rich
textbox the alignment all messed up. Please help me to solve this problem.

Set the font of the textbox to Courier New (or some other fixed-width
font, eg Lucida Console).
 
G

George Hardy

change the textbox font to something that is monospaced. Courier New is a
truetype font that has the same width for a "I" as a "W". If you use a font
like Arial, then the "I" will be much narrower, and your text alignment is
off.

hth
gh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top