I have found out how to print to the printer using a Rich Text Box and a single text box. I would like to know if there is a way to print the contents of numerous standard textboxes (of a given form) to the printer.
Printable View
I have found out how to print to the printer using a Rich Text Box and a single text box. I would like to know if there is a way to print the contents of numerous standard textboxes (of a given form) to the printer.
This will print all textboxes on the form:
Code:Private Sub printboxes(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs)
For Each ctl In Me.Controls
If TypeOf ctl Is TextBox Then
Dim txt As TextBox = ctl
e.Graphics.DrawString(txt.Text, New Font("Arial", 9, FontStyle.Bold), Brushes.Blue, txt.Left, txt.Top)
End If
Next
end sub
Very Generic, but should give you the idea!