I generate random number and it is of four columns in the listbox. I want to print it out. With the following VB.Net code, it prints only the first column, not the other three columns. Can any one help me, so that I may have all these columns printed out.
CODE
Public Class Form1
Private Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
PrintDocument1.Print()
End Sub
Private Sub PrintPrintDocument1_PrintPage(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
Dim printFont As New Font("Arial", 12)
Dim lineHeightSingle As Single = printFont.GetHeight + 2
Dim horizontalPrintLocationSingle As Single = e.MarginBounds.Left
Dim verticalPrintLocationSingle As Single = e.MarginBounds.Top
Dim printLineString As String
Dim listIndexInteger As Integer
For listIndexInteger = 0 To Me.ListBox1.Items.Count - 1
verticalPrintLocationSingle += lineHeightSingle
printLineString = Me.ListBox1.Items(listIndexInteger).ToString
e.Graphics.DrawString(printLineString, printFont, Brushes.Black, horizontalPrintLocationSingle, verticalPrintLocationSingle)
Next listIndexInteger
End Sub