Text in Text Box Is Not Flush Left in Non-Office Programs (268775)



The information in this article applies to:

  • Microsoft Windows NT Workstation 4.0
  • Microsoft Windows NT Server 4.0

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 "More Information" 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.

Modification Type:MinorLast Reviewed:9/26/2005
Keywords:kbHotfixServer kbQFE kbfix kbprb KB268775