RequestPrint Event - .NET

<< Click to Display Table of Contents >>

Navigation:  Events Generated by the .NET Control >

RequestPrint Event - .NET

Previous pageReturn to chapter overviewNext page

Is fired to inform the application about the several stages during the printing process.

RequestPrintEventHandler VPE.RequestPrint(

object sender,

RequestPrintEventArgs e

)

object sender

the VPE document object that fired the event

RequestPrintEventArgs e

event data, derived from EventArgs, two additional members:

public class RequestPrintEventArgs : EventArgs

{

public PrintAction Action;

public PrintResultingAction PrintResultingAction;

}

 

PrintAction enumeration:

public enum PrintAction

{

Abort,

// User aborted while printing

Start,

// Print started

End,

// Print ended

SetupAbort,

// User aborted Setup-Dialog

SetupStart,

// Setup-Dialog started

SetupEnd,

// Setup-Dialog ended

}

 

PrintResultingAction enumeration:

is a return-parameter, i.e. you can assign it one of the following values to control the resulting action of VPE:

public enum PrintResultingAction

{

Ok,

Abort,

}

Remarks:

Do not call CloseDoc() while processing this event. You would terminate a module that is working.

 

When your application handles this event, the PrintAction member contains the current status of the printing progress. Your applications’s event handler can return a value in the PrintResultingAction member.

 

Your application should return Ok if it processes this message, except for PrintAction = SetupStart, where your application may return in addition Abort to abort the print job. SetupStart is sent, when the user clicked the print button in the preview (or pushed the corresponding key). You have the option to abort the job, for you can then create and print internally a new document which is completely different to the preview.

 

Another use for the SetupStart message is, to pre-initialize the Device Control Properties at this stage, before the printer setup dialog will be shown to the user.