GdPicture.NET.14
GdPicture14.WPF 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.

The event makes use of bubble routing strategy. Please check the corresponded GdViewer.BeforePrintPageEventArgs for given parameters.

Syntax
'Declaration
 
Public Event BeforePrintPage As GdViewer.BeforePrintPageHandler
public event GdViewer.BeforePrintPageHandler BeforePrintPage
public event BeforePrintPage: GdViewer.BeforePrintPageHandler; 
In JScript, you can handle the events defined by another class, but you cannot define your own.
public: __event GdViewer.BeforePrintPageHandler* BeforePrintPage
public:
event GdViewer.BeforePrintPageHandler^ BeforePrintPage
Event Data

The event handler receives an argument of type GdViewer.BeforePrintPageEventArgs containing data related to this event. The following GdViewer.BeforePrintPageEventArgs properties provide information specific to this event.

PropertyDescription
Gets or sets a value indicating whether the print job should be canceled. Switching this value to true will subsequently terminate the printing job.  
(Inherited from System.Windows.RoutedEventArgs)
(Inherited from System.Windows.RoutedEventArgs)
The page number of the page to be printed.  
The number of pages left for printing.  
(Inherited from System.Windows.RoutedEventArgs)
(Inherited from System.Windows.RoutedEventArgs)
Example
How to utilize this event in your GdViewer control.
'We assume that the GdViewer1 control has been properly integrated
'and the BeforePrintPage event has been properly added.
            
'Define the event.
Sub GdViewer1_BeforePrintPage(ByVal sender As Object, ByVal e As GdPicture14.WPF.GdViewer.BeforePrintPageEventArgs)
    MessageBox.Show("The page to be printed: " + e.Page.ToString(), "GdViewer.BeforePrintPage")
End Sub
//We assume that the GdViewer1 control has been properly integrated
//and the BeforePrintPage event has been properly added.
            
//Define the event.
void GdViewer1_BeforePrintPage(object sender, GdPicture14.WPF.GdViewer.BeforePrintPageEventArgs e)
{
    MessageBox.Show("The page to be printed: " + e.Page.ToString(), "GdViewer.BeforePrintPage");
}
See Also