Microsoft KB Archive/153022

{|
 * width="100%"|

-

The information in this article applies to:


 * Microsoft Visual Basic Professional and Enterprise Editions, 16-bit only, for Windows, version 4.0

-

SYMPTOMS
Graphics drawn on a picture box with the graphics methods will not appear when the form containing that picture box is printed using the PrintForm method. This problem only occurs when running the 16-bit version of Visual Basic 4.0 on the Windows 95 or Windows 98 operating systems. It does not occur with the 32-bit version on any operating system, or with the 16-bit version on Windows NT (3.51) or any of the 16-bit Windows operating systems. Bitmaps and/or icons print correctly. The AutoRedraw property has no effect on this problem.

RESOLUTION
To work around this problem, use the procedures detailed in the following article in the Microsoft Knowledge Base:

"Q141933 HOWTO: Capture & Print the Screen, a Form, or any Window in VB" These methods will print the form and the contents of the picture box control correctly.

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

Steps to Reproduce
 Start Visual Basic 4.0, 16-bit edition on Windows 95 or Windows 98. Form1 is created by default. Add a single PictureBox control and a two CommandButtons to the form.  Add this code to Form1:      Private Sub Command1_Click Picture1.Line (10, 10)-(500, 500) Picture1.Line (10, 500)-(500, 10) End Sub

Private Sub Command2_Click Form1.PrintForm End Sub  Press the F5 key or select Start from the Run menu to run the application. Click Command1 to add the graphics to the picture box, click Command2 to print the form. After printing is complete, notice that the picture box on the printed page is empty.

Additional query words: kbprint kbVBp kbDSupport kbdsd kbVBp400BUG

Keywords : kbprint kbVBp400bug kbGrpVB

Version : 4.0

Platform : WINDOWS

Issue type : kbbug
 * }