BUG: Printer.DrawWidth Appears To Be Ignored with Windows 95/98
ID: Q190216
|
The information in this article applies to:
-
Microsoft Visual Basic Learning, Professional, and Enterprise Editions for Windows, 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 INFORMATIONSteps to Reproduce Behavior
- Open a New Standard EXE Project. Form1 is created by default.
- 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
- 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.
- Stop the Project.
- 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.
- Stop the Project.
- 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:
Q176634
: BUG: Line/Circle Methods Don't Print as Transparent on Win95/98
Additional query words:
kbDSupport kbdsd KBPrinting kbVBp500bug kbVBp600bug kbVBp
Keywords : kbGrpVB
Version :
Platform : WINDOWS
Issue type : kbbug
|