
Printing nightmare...I'm losing my mind!!!
Here's a hint, just adjust it to your needs...
Private Declare Function BitBlt Lib "gdi32.dll" (ByVal hdcDest As IntPtr,
ByVal x As Int32, ByVal y As Int32, ByVal Width As Int32, ByVal Height As
Int32, ByVal hdcSrc As IntPtr, ByVal XSrc As Int32, ByVal YSrc As Int32,
ByVal dwRop As Int32) As Boolean
Private Declare Function GetWindowDC Lib "user32" (ByVal hWnd As IntPtr) As
IntPtr
Private Declare Function ReleaseDC Lib "user32" (ByVal hWnd As IntPtr, ByVal
hDc As IntPtr) As IntPtr
Dim memImage As New Bitmap(form.Width, form.Height)
Dim memGraphic As Graphics = Graphics.FromImage(memImage)
Dim dc1 As IntPtr = GetWindowDC(form.Handle)
Dim dc2 As IntPtr = memGraphic.GetHdc
BitBlt(dc2, 0, 0, Me.Size.Width, Me.Size.Height, dc1, 0, 0, &HCC0020)
ReleaseDC(form.Handle, dc1)
memGraphic.ReleaseHdc(dc2)
Dim pd as new PrinDocument
pd.Print
On PrinPage event: e.DrawImage (memImage,...)
Dont forget to dispose memimage after use...
HTH
--
Corrado Cavalli [Microsoft MVP]
UGIdotNET - http://www.ugidotnet.org