' agregar esta ref .. System.Drawing
Imports System.Drawing.Printing
Dim ContenidoDelTexto As PrintPageEventArgs
Dim WithEvents Reporte As New PrintDocument()
Private Sub Button_Click(ByVal sender As System.Object, ByVal _
e As System.EventArgs) Handles Button.Click
Dim printdialog As New PrintDialog()
Dim printsettings As New PrinterSettings()
printdialog.ShowDialog()
Reporte.Print()
End Sub
Private Sub Reporte_PrintPage(ByVal sender As System.Object, ByVal _
e As System.Drawing.Printing.PrintPageEventArgs) Handles _
Reporte.PrintPage
ContenidoDelTexto = e
ContenidoDelTexto.Graphics.DrawString(Label1.Text & vbCrLf & TextBox1.Text, _
New Font("Arial", 12), _
Brushes.Blue, _
ContenidoDelTexto.MarginBounds.Left, ContenidoDelTexto.MarginBounds.Top)
ContenidoDelTexto.HasMorePages = False
End Sub
Dim impresora As New PrintDialog()
Sub Configurar()
impresora.Document = Reporte
impresora.ShowDialog()
Reporte.PrinterSettings = impresora.PrinterSettings
End Sub