Sunday, November 30, 2008

VB.NET 2008 Printing

Tired of all those useless cunts attempting to give really crappy advice?

Here's the real deal.

Drag and drop a PrinterDocument onto your form.

Set a button.

Button click does PrinterDocument1.Print()

Create a handler for this, ie override .Print().

Use System.Drawing.Printing.PrintPageEventArgs for 'e' in the argument list, and set to 'Handles PrinterDocument1.PrintPage.

Then, in the body of this method, say e.Graphics.DrawString(fill this in) for text,

or for a picture, e.Graphics.DrawImage(fill this in)

It really is that simple.

Five lines, and there are all these uselss dickheads filling the www with rubbish going on from reference to reference and site to site, sometimes pages long, telling nobody anything.

It's an embarrassment.

No comments: