Microsoft KB Archive/318722

= PRB: PrintForm Does Not Print the ListView Content =

Article ID: 318722

Article Last Modified on 6/5/2003

-

APPLIES TO


 * Microsoft Visual Basic 6.0 Enterprise Edition
 * Microsoft Visual Basic 6.0 Learning Edition
 * Microsoft Visual Basic 6.0 Professional Edition

-



This article was previously published under Q318722



SYMPTOMS
When you use Microsoft Windows Common Controls 6.0, the items in the ListView control do not print with the PrintForm method of the form. Only the first item in the ListView may be visible on the printed document.



RESOLUTION
To resolve this issue, use either of the following methods:  Instead of using Windows Common Controls 6.0, use Windows Common Controls 5.0. -or-

 Instead of using the PrintForm method to print the form, use the Windows API (as shown in the following Microsoft Knowledge Base article), and set the Visible property of the PictureBox object to False.

161299 HOWTO: Capture and Print the Screen, a Form, or Any Window





Steps to Reproduce the Behavior
 Start a new project.

By default, Form1 is created. On the Project menu, click Components, and then click Windows Common Controls 6.0. Add a ListView and a CommandButton to Form1.</li>  Add the following code to the Code window of Form1: Option Explicit

Private Sub Command1_Click Form1.PrintForm End Sub

Private Sub Form_Load Dim i As Integer For i = 1 To 10 ListView1.ListItems.Add, , &quot;Item &quot; & i Next i End Sub </li> Run the project, and then click the button to print the form.

You experience the issue described in the &quot;Symptoms&quot; section of this article.</li></ol>

Keywords: kbprb KB318722

-

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

© Microsoft Corporation. All rights reserved.