Printing is completely different in
VB.Net to VB6. The nearest thing you have to the printer object is the PrintDocument class, that represents the connection between an app and a printer.
It raises an event for each page to be printed, so you need to handle this event and supply the text/graphics to be printed.
The other classes you'll need are in System.Drawing.Printing
Example:
Drop a textbox, button and PrintDocument component onto a new form.
in the button click event handler put
Code:
PrintDocument1.Print
Then add the following code at the bottom of the form class
Private Sub PrintDocument1_PrintPage(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
' create a new font to print with...
Dim fnt As New Font("Arial", 10, FontStyle.Regular, GraphicsUnit.Point)
' print the text from the text box...
e.Graphics.DrawString(TextBox1.Text, fnt, Brushes.Black, 0, 0)
' end printing by indicating there are no more pages...
e.HasMorePages = False
End Sub