Back to Devexpress

PrintingSystemBase.BeforeMarginsChange Event

corelibraries-devexpress-dot-xtraprinting-dot-printingsystembase-a6c1701c.md

latest2.4 KB
Original Source

PrintingSystemBase.BeforeMarginsChange Event

Occurs when page margins are about to change.

Namespace : DevExpress.XtraPrinting

Assembly : DevExpress.Printing.v25.2.Core.dll

NuGet Package : DevExpress.Printing.Core

Declaration

csharp
public event MarginsChangeEventHandler BeforeMarginsChange
vb
Public Event BeforeMarginsChange As MarginsChangeEventHandler

Event Data

The BeforeMarginsChange event's data class is MarginsChangeEventArgs. The following properties provide information specific to this event:

PropertyDescription
SideGets changed page margins.
ValueGets or sets the changed margin size in hundredths of an inch.

Remarks

When this event occurs, the MarginsChangeEventArgs.Value contains the changed margin size. You can change it back to an appropriate value if necessary.

Example

The following example uses the PrintingSystemBase.BeforeMarginsChange event handler to change the margin size to the default value of 100, if the margins have been moved:

csharp
using DevExpress.XtraPrinting;
// ...

private void printingSystem1_BeforeMarginsChange(object sender, 
MarginsChangeEventArgs e) {

    if (e.Value != 100) e.Value = 100;

}
vb
Imports DevExpress.XtraPrinting
' ...

Private Sub PrintingSystem1_BeforeMarginsChange(ByVal sender As Object, ByVal e _
    As MarginsChangeEventArgs) Handles PrintingSystem1.BeforeMarginsChange

    If e.Value <> 100 Then e.Value = 100

End Sub

See Also

PrintingSystemBase Class

PrintingSystemBase Members

DevExpress.XtraPrinting Namespace