Screenshot window and print

What Im trying to do is print the whole window Im currently in by taking a screenshot or something. Any ideas how to achieve this?

This is code I have used called from a menu item:

Var ps As New PrinterSetup
Var g As Graphics
g = ps.ShowPrinterDialog()
If g <> Nil Then
  Var p As New Picture( Main.Width, Main.Height, 32)
  Main.DrawInto p.Graphics, 0, 0
  Var gheight As Integer = g.Width/p.Width*p.Height
  g.DrawPicture p, 0, 0, g.Width, gheight, 0, 0, p.Width, p.Height
End If
Return True

Dennis