S
SamSpade
I have this class that seems to work OK. Note that I supply the actual PD in
the call.
Public Class ImagePrint
Private mPD As Drawing.Printing.PrintDocument
-snip
Public Sub PrintIt(ByVal PD As PrintDocument, ByVal PicImage As Image, ByVal
DocName As String, ByVal Fit As PrintFit, ByVal Center As CenterImage, ByVal
DoPreview As Boolean)
mPD = PD
mImage = PicImage
mFitPage = Fit
mCenterImage = Center
AddHandler PD.PrintPage, AddressOf mPD_PrintPage
PD.DocumentName = DocName
-snip
Created a new class and copied some code from the other class but had to add
the WithEvents because the compler said so. Seems to work OK. It troubles
me that I may be doing something wrong (but in which one). Do you know what
and where??
Public Class RtfPrint
Private WithEvents mPD As Drawing.Printing.PrintDocument
Private RtfBox As RichTextBox
-snip
Public Sub PrintIt(ByVal PD As PrintDocument, ByVal RtfTextBox As
RichTextBox, ByVal DocName As String, ByVal Fit As PrintFit, ByVal Center As
CenterImage, ByVal DoPreview As Boolean)
mPD = PD
RtfBox = RtfTextBox
mFitPage = Fit
mCenterImage = Center
AddHandler PD.BeginPrint, AddressOf mpd_BeginPrint
AddHandler PD.PrintPage, AddressOf mpd_PrintPage
AddHandler PD.EndPrint, AddressOf mpd_EndPrint
PD.DocumentName = DocName
-snip
the call.
Public Class ImagePrint
Private mPD As Drawing.Printing.PrintDocument
-snip
Public Sub PrintIt(ByVal PD As PrintDocument, ByVal PicImage As Image, ByVal
DocName As String, ByVal Fit As PrintFit, ByVal Center As CenterImage, ByVal
DoPreview As Boolean)
mPD = PD
mImage = PicImage
mFitPage = Fit
mCenterImage = Center
AddHandler PD.PrintPage, AddressOf mPD_PrintPage
PD.DocumentName = DocName
-snip
Created a new class and copied some code from the other class but had to add
the WithEvents because the compler said so. Seems to work OK. It troubles
me that I may be doing something wrong (but in which one). Do you know what
and where??
Public Class RtfPrint
Private WithEvents mPD As Drawing.Printing.PrintDocument
Private RtfBox As RichTextBox
-snip
Public Sub PrintIt(ByVal PD As PrintDocument, ByVal RtfTextBox As
RichTextBox, ByVal DocName As String, ByVal Fit As PrintFit, ByVal Center As
CenterImage, ByVal DoPreview As Boolean)
mPD = PD
RtfBox = RtfTextBox
mFitPage = Fit
mCenterImage = Center
AddHandler PD.BeginPrint, AddressOf mpd_BeginPrint
AddHandler PD.PrintPage, AddressOf mpd_PrintPage
AddHandler PD.EndPrint, AddressOf mpd_EndPrint
PD.DocumentName = DocName
-snip