'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.
Property | Description |
---|---|
Cancel | Gets or sets a value indicating whether the print job should be canceled. Switching this value to true will subsequently terminate the printing job. |
Handled | (Inherited from System.Windows.RoutedEventArgs) |
OriginalSource | (Inherited from System.Windows.RoutedEventArgs) |
Page | The page number of the page to be printed. |
PagesLeft | The number of pages left for printing. |
RoutedEvent | (Inherited from System.Windows.RoutedEventArgs) |
Source | (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