Tom,
Printing doesn't really work that way anymore. It works more like the
hDc drawing methods used by C++ before. Having said that you should look at
the example printing items using PrintDocument in the help files. Basically
all page drawing is done inside a PrintPage event of the document. Setting
the HasMorePages property of the PrintPageEventA rgs variable to true and
returning will do a new page and then re-enter the event to draw the
following page(s). Setting HasMorePage to false and returning is the
equivalent of Printer.EndDoc. Note that you need to keep track of your
print items outside of the PrintPage event as it gets re-run from the top on
every page.
Text Height/Width are (roughly) equivalent to MeasureString on the
Graphics of the supplied argument (say e for further discussion). So
e.Graphics.Meas ureString("The String", theFont, ...) will return a size with
a height/width (see the various overloads for more detail).
e.Graphics.Draw Image is somewhat like PaintPicture, e.Graphics.Draw String is
like Print and e.Graphics.Draw Line is like Line. You will have to supply
Pens, Fonts, and Brushes to these calls.
Normally I initialize all Fonts, and all non-standard Brushes and Pens
as well as the document datastream in the OnBeginPrint of the derived
PrintDocument class and dispose them properly in OnEndPrint. If you want to
handle landscape/portrait switching set the appropriate flag in the
QueryPageSettin gsEventArgs (e.PageSettings .Landscape) for the
OnQueryPageSett ings event which is performed for each page.
Ron Allen
"Tom Berry" <tb***@planetes hop.com> wrote in message
news:u8******** ******@TK2MSFTN GP11.phx.gbl...
We currently are trying our first transformation from VB6 to VB.Net. Of
course, the Printer object is gone, but I'm having trouble finding the
replacement syntax necessary to perform similar actions or set variables.
We are interested in doing this inline (no pop-up dialog box).
Specifically, where how would I replace the following properties/methods
of the old Printer objects.
Printer.NewPage
Printer.TextHei ght
Printer.TextWid th
Printer.PaintPi cture
Printer.Print
Printer.Line
Printer.EndDoc
Thanks, Tom.