Add a printDocument control
add code to the control like
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e
As System.Drawing.Printing.PrintPageEventArgs) Handles
PrintDocument1.PrintPage
Dim li As String
Dim nY_Loc, x_Marge As Long
Dim Myfont As New Font("Arial", FontStyle.Regular)
Try
For Each li In ListBox1.Items
e.Graphics.DrawString(li, MyFont, Brushes.Blue, x_Marge, nY_Loc)
nY_Loc += e.Graphics.MeasureString(li, Myfont).Height
Next
Catch ex As Exception
MsgBox("Something whent wrong")
End Try
End Sub
"Samuel" <Sa****@discussions.microsoft.com> schreef in bericht
news:0B**********************************@microsof t.com...
Hi!
How can I print data stored in a listView?
I only found some vb6.0 code and I wonder how to substitute the
printer-object etc.
are there any possibilities of printing easily using the .net framework?
or should i use another control and no listview?
please help me ;)
Samuel