PrintPageHeader Problems

cpopham

Junior Contributor
Joined
Feb 18, 2004
Messages
273
I have found a piece of code that will allow me to print with a listview. However, when I code the PrintPageHeader portion, it says PrintPageHeader is not declared. I did not know that i had to declare it and if I do declare it what do I declare it as? Anyway here is my code so far:

Code:
Private Sub PD_PrintPage(ByVal sender As Object, _
                            ByVal e As System.Drawing.Printing.PrintPageEventArgs) _
                            Handles PD.PrintPage

        PageNo += 1
        PageWidth = PWidth - _
                    (PD.DefaultPageSettings.Margins.Left + _
                    PD.DefaultPageSettings.Margins.Right)
        PageHeight = PHeight - _
                    (PD.DefaultPageSettings.Margins.Top + _
                    PD.DefaultPageSettings.Margins.Bottom)
        X = PD.DefaultPageSettings.Margins.Left
        Y = PD.DefaultPageSettings.Margins.Top
        Static startItem As Integer
        Dim ColWidths(Me.ListView1.Columns.Count - 1) As Integer

        ' -Calculate the width of each column and the total width of the grid
        Dim i As Integer, totWidth As Integer
        For i = 0 To Me.ListView1.Columns.Count - 1
            ColWidths(i) = Me.ListView1.Columns(i).Width
            totWidth = totWidth + ColWidths(i)
        Next i

        PrintPageHeader(e.Graphics)  'Problem is here

    End Sub

Any Ideas?

Thanks, Chester
 
PrintPageHeader is a function that prints the header. Apparently you don't have the function.
 
Back
Top