DOCUMENT:Q190216 07-AUG-1998 [vbwin] TITLE :BUG: Printer.DrawWidth Appears To Be Ignored with Windows 95/98 PRODUCT :Microsoft Visual Basic for Windows PROD/VER: OPER/SYS:WINDOWS KEYWORDS: ====================================================================== --------------------------------------------------------------------- The information in this article applies to: - Microsoft Visual Basic for Windows Learning, Professional, and Enterprise Editions, version 6.0 - Microsoft Visual Basic Control Creation, Learning, Professional, and Enterprise Editions for Windows, version 5.0 --------------------------------------------------------------------- SYMPTOMS ======== Printing lines and/or circles ignores your Printer.DrawWidth setting, producing thin lines with the default DrawWidth of 1 instead of the thicker lines desired. RESOLUTION ========== This can often be resolved by adding the following line before any other printing or the setting of any Printer object properties: Printer.Print But a more reliable method is to print a Null circle with the following: Printer.DrawWidth = 1 Printer.Circle (0, 0), 0 before any other printing or setting the DrawWidth property to the desired value. STATUS ====== Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available. MORE INFORMATION ================ Steps to Reproduce Behavior --------------------------- 1. Open a New Standard EXE Project. Form1 is created by default. 2. Insert the following code into the Form's module: Private Sub Form_Click() 'Printer.Print ' may work 'Printer.DrawWidth = 1 ' To make sure Null Circle is not visible 'Printer.Circle (0, 0), 0 ' Print Null Circle Printer.DrawWidth = 50 Printer.Line (200, 500)-(Printer.ScaleWidth - 300, 1500), , B Printer.Circle (Printer.ScaleWidth \ 2, Printer.ScaleHeight \ 2), _ Printer.ScaleWidth \ 3 Printer.Line (200, 2500)-(Printer.ScaleWidth - 300, 2500) Printer.Line (200, Printer.ScaleHeight - 1200)- _ (Printer.ScaleWidth - 300, Printer.ScaleHeight - 200), , B Printer.EndDoc End Sub 3. Run the Project and click on the Form. Your printout will have a horizontal box across the top of the page, followed by a horizontal line, a large circle, and finally, a horizontal box across the bottom of the page. Note that at least the first box will be in thin lines rather than the thick lines expected for a DrawWidth of 50, indicating that the DrawWidth setting was ignored for the Printer object. 4. Stop the Project. 5. Uncomment the Printer.Print line and repeat step 3. The printout may now be the same or it may be correct with all objects drawn with a DrawWidth of 50. 6. Stop the Project. 7. Comment out the Printer.Print line and uncomment the next two lines to draw the Null circle, and then repeat step 3. Note that the lines and circle are now printed with thick lines as desired. REFERENCES ========== For information on a related bug, please see the following article in the Microsoft Knowledge Base: ARTICLE-ID: Q176634 TITLE : BUG: Line/Circle Methods Don't Print as Transparent on Win95/98 Additional query words: kbDSupport kbdsd KBPrinting kbVBp500bug kbVBp600bug kbVBp ====================================================================== Platform : WINDOWS Issue type : kbbug ============================================================================= THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY. Copyright Microsoft Corporation 1998.