Microsoft KB Archive/190216

= BUG: Printer.DrawWidth Appears To Be Ignored with Windows 95/98 =

Article ID: 190216

Article Last Modified on 5/13/2003

-

APPLIES TO

 Microsoft Visual Basic 5.0 Learning Edition, when used with:  Microsoft Windows 95

 Microsoft Windows 98 Standard Edition  Microsoft Visual Basic 6.0 Learning Edition, when used with:  Microsoft Windows 95

 Microsoft Windows 98 Standard Edition</li></ul> </li> Microsoft Visual Basic 5.0 Professional Edition, when used with:  Microsoft Windows 95</li></ul>

 Microsoft Windows 98 Standard Edition</li></ul> </li> Microsoft Visual Basic 6.0 Professional Edition, when used with:  Microsoft Windows 95</li></ul>

 Microsoft Windows 98 Standard Edition</li></ul> </li> Microsoft Visual Basic 5.0 Enterprise Edition, when used with:  Microsoft Windows 95</li></ul>

 <li>Microsoft Windows 98 Standard Edition</li></ul> </li> <li>Microsoft Visual Basic 6.0 Enterprise Edition, when used with: <ul> <li>Microsoft Windows 95</li></ul>

<ul> <li>Microsoft Windows 98 Standard Edition</li></ul> </li> <li>Microsoft Visual Basic 5.0 Control Creation Edition, when used with: <ul> <li>Microsoft Windows 95</li></ul>

<ul> <li>Microsoft Windows 98 Standard Edition</li></ul> </li></ul>

-

<div class="notice_section">

This article was previously published under Q190216

<div class="symptoms_section">

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.

<div class="resolution_section">

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.

<div class="status_section">

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.

<div class="moreinformation_section">

Steps to Reproduce Behavior
<ol> <li>Open a New Standard EXE Project. Form1 is created by default.</li> <li> 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

</li> <li>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.</li> <li>Stop the Project.</li> <li>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.</li> <li>Stop the Project.</li> <li>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.</li></ol>

<div class="references_section">