title: Printing Column Headers from Listview
body: <p>How do I include the column items of the <code>Listview</code> to be printed? All it prints are the items, so what should I do with this?</p>
  
  <p>This is my code:</p>
  
  <pre><code>Public Class Form9
  
    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
      Dim prn As New Printing.PrintDocument
      prn.PrinterSettings.PrinterName.ToString()
      AddHandler prn.PrintPage, AddressOf Me.PrintPageHandler
      prn.Print()
      RemoveHandler prn.PrintPage, AddressOf Me.PrintPageHandler
    End Sub
  
    Private Sub PrintPageHandler(sender As Object, args As PrintPageEventArgs)
      Dim lvwItem As ListViewItem
      Dim lvwSubItem As ListViewItem.ListViewSubItem
      Dim xPos As Integer = 0
      Dim yPos As Integer = 0
      Dim listviewcount As Integer = 1
  
      For Each lvwItem In lvPeople.Items
        xPos = 0
        For Each lvwSubItem In lvwItem.SubItems
          xPos += 100
          yPos = 100 + (listviewcount * 15)
          args.Graphics.DrawString(lvwSubItem.Text(), _
                  New Font("Arial", 10, FontStyle.Regular), _
                  Brushes.Black, xPos, yPos)
        Next
        listviewcount += 1
      Next
    End Sub
  End Class
  </code></pre>