Found a solution to the > 1 page issue. I'm using the t variable to remove the first line that was serving as the header, but can't get the VbTab to line up the same.
Thanks for your help Hack!
vb Code:
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage Dim t As Integer = -1 Dim ListBoxItem As String = String.Empty For Each LBItem As String In LstResults.Items If t >= 0 Then ListBoxItem = ListBoxItem & vbCrLf & LBItem Else t = t + 1 End If Next Static Lines() As String = ListBoxItem.Split(vbCrLf) Static Font As New Font("Arial", 16, FontStyle.Regular, GraphicsUnit.Pixel) Static I As Integer Dim VerticalPos As Integer = 20 Do e.Graphics.DrawString(Lines(I), Font, Brushes.Black, 20, VerticalPos) I += 1 VerticalPos += Font.Height If VerticalPos > e.PageBounds.Bottom Then e.HasMorePages = True Return End If Loop Until I = Lines.Length End Sub




Reply With Quote
