FIX: Printer.TextWidth Returning Inconsistent Results in IDELast reviewed: December 18, 1997Article ID: Q171815 |
The information in this article applies to:
SYMPTOMSUsing Printer.TextWidth from the IDE works correctly the first time a project is run, but may return incorrect values after that. You must completely close Visual Basic and restart to see correct results again. The TextWidth method works correctly for other objects, and Printer.TextWidth works correctly in an EXE.
CAUSEVisual Basic closes the Printer Object's Font information incorrectly when switching from run-time to design-time, so, on subsequent runs, the Font information may not be retrieved properly.
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug has been fixed in Visual Studio 97 Service Pack 2. For more information on the Visual Studio 97 Service Pack 2, please see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q170365 TITLE : INFO: Visual Studio 97 Service Packs - What, Where, and WhyFor a list of the Visual Basic 5.0 bugs that were fixed in the Visual Studio 97 Service Pack 2, please see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q171554 TITLE : INFO: Visual Basic 5.0 Fixes in Visual Studio 97 Service Pack 2 MORE INFORMATION
Steps to Reproduce Behavior
Results are unaffected by using a StdFont object or by resetting the Printer and Font. For example, adding this before setting the font does not help:
Printer.Print "" Printer.Font = "" Printer.ScaleMode = 1 Keywords : vb5all VS97FixlistSP3 VS97FixlistSP2 VB5FixlistSP2 Version : 5.0 Platform : WINDOWS Issue type : kbbug Solution Type : kbfix kbservicepack |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |