473,763 Members | 5,412 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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
Jan 17 '06 #1
4 2705
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
"Nina" wrote:
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

Jan 17 '06 #2

Nina wrote:
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).

--
Larry Lard
Replies to group please

Jan 17 '06 #3
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
"Nina" <Ni**@discussio ns.microsoft.co m> wrote in message
news:E4******** *************** ***********@mic rosoft.com...
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

Jan 17 '06 #4
Thank you so much to all of you. It displays perfectly now.

Thanks again.

Nina

"George Hardy" wrote:
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
"Nina" <Ni**@discussio ns.microsoft.co m> wrote in message
news:E4******** *************** ***********@mic rosoft.com...
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


Jan 17 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3914
by: Hendrik Schober | last post by:
Hi, we just run into the problem, that "default" alignment in the project properies dialog seem to be different. We have a project that's a DLL, which is linked with a couple of LIBs. All are with the same solution. All had "Default" set in the "Struct Member Alignment" entry. After some assembler debugging we found out that a struct member that is a member function pointer in
0
1227
by: Earl Teigrob | last post by:
I can create a new custom control (and not change it) and add it to the toolbox and drag it onto the disign screen and it works just fine, displaying the text . However, when I add the following datepicker control to the toolbox, it just shows a yellow dot and thats it. What happened to the text??? Earl
4
1483
by: JIM.H. | last post by:
how do you do Alignment in a textbox?
2
8093
by: John Smith | last post by:
Hi all; Putting "Due" into the column header of a datagrid. Font is a proportional fort. When the alignment is left, there is some space between the column separator bar and the D in Due. When the alignment is center, Due is centered in the header box. When the alignment is right, the e in Due is partially covered by the column separator bar. Adding space after Due (i.e.. "Due ") does not work. HeaderText seems to be trimmed before...
3
4196
by: Simon Abolnar | last post by:
Is it possible to align headers and text in different way. Because with: dgts.GridColumnStyles(0).Alignment = HorizontalAlignment.Center alignment is set for all column (header and text). Thanks for help! Simon
7
2040
by: Earl | last post by:
Any known fixes for the wacky right-alignment bug in the WinForms datagrid (VS2003)? I've tried Ken's workaround (http://www.windowsformsdatagridhelp.com/default.aspx?ID=4bfab32d-9cff-4f5c-ba95-49bb9074a8bc), but I get no alignment at all when calling the class. George Shephard's site, while imminently useful, does not have an anwer for this issue.
7
1974
by: Doug Bell | last post by:
Hi Does anyone know (or point me where I can find) how to set the alignment of a DataGrid Column Header different to the alignment of the column. I am trying to show some Right aligned columns and the header looks wrong squashed to the right. If I could even add a trailing space but it trims any trailing spaces off. Thanks
1
1589
by: jobs | last post by:
I have a content page with a bunch of controls. They are not under a table. I add textboxes and they are won't align left justified like other controls. In Designer they all seem left justified. I look at the html rendered and can't explain this alignment ??? I'm running asp.net 2.0 and I.E. 6.0. the control in question is : ctl00$ContentPlaceHolder1$DateFilter snip..
2
1709
by: gee | last post by:
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 for printing all alignments are changed. Please help me to solve this problem. Thanks in advance. G
0
9386
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10144
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9997
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9937
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9822
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7366
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5270
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3917
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.