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. STATUS
Microsoft 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. Q170365 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: Q171554 INFO: Visual Basic 5.0 Fixes in Visual Studio 97 Service Pack 2 MORE INFORMATIONSteps 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:
Additional query words:
Keywords : kbVBp500 kbVS97sp2fix kbGrpVB kbvbp500sp2fix |
Last Reviewed: January 5, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |