XandrilZaax
New member
- Joined
- Jun 3, 2006
- Messages
- 3
- Programming Experience
- Beginner
Hey all. I'm trying to implement a procedure that prints just the contents of a listbox, and cant figure it out. Does anyone know how to do this?
PrintPreviewDialog1.ShowDialog()
Private Sub PrintDocument1_PrintPage(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
Dim f As New Font("Eurostyle", 16, FontStyle.Regular)
Dim x As Single, y As Single
Dim h As Single = 30
x = e.MarginBounds.Left
y = e.MarginBounds.Top
Dim item As String
For Each item In ListBox1.Items
e.Graphics.DrawString(item, f, Brushes.Black, x, y)
y += h
Next
End Sub