GdPicture.NET.14
GdPicture14 Namespace / GdViewer Class / BeforePrintPage Event
Example





In This Topic
BeforePrintPage Event (GdViewer)
In This Topic
This event is raised right before a page is to be printed through the GdViewer control using one of the Print or PrintDialog methods.

Please check the corresponded GdViewer.BeforePrintPageEventHandler for given parameters.

Syntax
'Declaration
 
Public Event BeforePrintPage As GdViewer.BeforePrintPageEventHandler
public event GdViewer.BeforePrintPageEventHandler BeforePrintPage
public event BeforePrintPage: GdViewer.BeforePrintPageEventHandler; 
In JScript, you can handle the events defined by another class, but you cannot define your own.
public: __event GdViewer.BeforePrintPageEventHandler* BeforePrintPage
public:
event GdViewer.BeforePrintPageEventHandler^ BeforePrintPage
Example
How to add this event to your GdViewer control.
'We assume that the GdViewer1 control has been properly integrated.
Friend WithEvents GdViewer1 As GdPicture14.GdViewer
            
'Add the event.
AddHandler GdViewer1.BeforePrintPage, AddressOf GdViewer1_BeforePrintPage
            
'Define the event.
Sub GdViewer1_BeforePrintPage(ByVal Page As Integer, ByVal PageLeft As Integer) Handles GdViewer1.BeforePrintPage
    MessageBox.Show("The page to be printed: " + Page.ToString(), "GdViewer.BeforePrintPage")
End Sub
//We assume that the GdViewer1 control has been properly integrated.
            
//Add the event.
GdViewer1.BeforePrintPage += GdViewer1_BeforePrintPage;
            
//Define the event.
void GdViewer1_BeforePrintPage(int Page, int PageLeft, ref bool Cancel)
{
    MessageBox.Show("The page to be printed: " + Page.ToString(), "GdViewer.BeforePrintPage");
}
See Also