Microsoft KB Archive/268775

= Text in Text Box Is Not Flush Left in Non-Office Programs =

Article ID: 268775

Article Last Modified on 11/1/2006

-

APPLIES TO


 * Microsoft Windows NT Workstation 4.0 Developer Edition
 * Microsoft Windows NT Server 4.0 Standard Edition

-



This article was previously published under Q268775



SYMPTOMS
When you run a program that uses a TextBox control, text in the text box is not flush with the left margin, as you expect. Instead, the text is offset from the left margin.



CAUSE
This behavior does not occur in Microsoft Office. This behavior may occur when the following conditions are both true:
 * Big fonts are installed.
 * Your computer is running a program that was not created by using Microsoft Visual Basic version 6 or later.

The program you are using does not handle the edit control message EM_SETMARGINS. This message is sent by a program to set the widths of the left and right margins for an edit control, such as a text box. The message redraws the control to reflect the new margins.

This problem occurs with Microsoft Notepad and may occur with programs created by using third-party products such as Sybase PowerBuilder.



WORKAROUND
To work around this behavior, use one of the following methods as appropriate.

Method 1
Do not use big fonts. Remove these fonts and replace them with the versions of the fonts that are included with Windows NT. For a list of the affected fonts, please see the &quot;More Information&quot; section of this article.

WARNING: If you run Detect and Repair on your computer after you replace the fonts, the process replaces the installed fonts with the fonts included with Office 2000, because Office 2000 sees the installed fonts as damaged files.

Method 2 (for Developers)
Process and then ignore the ABC structure data for the EM_SETMARGINS edit box message.



MORE INFORMATION
A big font is a single font file that contains glyphs representing characters from multiple character sets.

A structure called the ABC structure contains the width of a character in a TrueType font. By default, edit boxes take into account the character widths and use the largest character width from all the languages that are stored in the font file. With languages such as Arabic, Hebrew, and Russian, the widths that are returned are quite large.

This functionality is in place in Windows NT 4.0 in order to support Unicode fonts.

Office 2000 installs or updates the following big fonts:

Arial

Arial Black

Arial Bold

Arial Narrow

Bookman Old Style

Courier New

Garamond

Impact

Tahoma

Times New Roman

Trebuchet (Central and Eastern European languages only)

Verdana

The third-party products that are discussed in this article are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, regarding the performance or reliability of these products.

Additional query words: office2000 off2000 office2k off2k o2k text margin winnt sp4 sp5 sp6 sp6a font service pack 7 sp7 user32.dll

Keywords: kbhotfixserver kbqfe kbfix kbprb KB268775

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.