Microsoft KB Archive/150222

= BUG: Graph Control Does Not Print When DrawMode Is Set to 5 =

Article ID: 150222

Article Last Modified on 7/14/2004

-

APPLIES TO


 * Microsoft Visual Basic 5.0 Control Creation Edition
 * Microsoft Visual Basic 5.0 Learning Edition
 * Microsoft Visual Basic 5.0 Professional Edition
 * Microsoft Visual Basic 5.0 Enterprise Edition
 * Microsoft Visual Basic 4.0 Standard Edition
 * Microsoft Visual Basic 4.0 Professional Edition
 * Microsoft Visual Basic 4.0 32-Bit Enterprise Edition

-



This article was previously published under Q150222



SYMPTOMS
If the DrawMode property of the Graph control is set to 5 when an application is running on Windows 95, nothing is printed. Under Windows NT, printing is not reliable either.



RESOLUTION
Use the PaintPicture method to print out the graph. The following code enables the graph to print out consistently: Printer.PaintPicture Graph1.Picture, Printer.Width / 4, _ Printer.Height / 4, Printer.Width / 2, Printer.Height / 2 Printer.EndDoc With the code above, the upper left-hand corner of the graph is positioned a quarter of the width of the paper across and down from the upper-left hand corner of the paper. The graph is made half as high and half as tall as the paper.

For additional options, please see the online Help for the PaintPicture method.



STATUS
Microsoft has confirmed this to be an issue in the Microsoft products listed at the beginning of this article.



Steps to Reproduce Problem
 Start a new project in Visual Basic. Form1 is created by default. Place a Graph control on Form1.  Place a Command button on Form1, and in the Click event for the Command button, place the following code: Private Sub Command1_Click Graph1.DrawMode = 5 End Sub 

Run the program by pressing the F5 key and press the Command button to print out the graph. The graph on the screen changes shading temporarily, but there is no print-out.

Keywords: kbbug KB150222

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.