corelibraries-devexpress-dot-xtraprinting-dot-printingsystembase-a6c1701c.md
Occurs when page margins are about to change.
Namespace : DevExpress.XtraPrinting
Assembly : DevExpress.Printing.v25.2.Core.dll
NuGet Package : DevExpress.Printing.Core
public event MarginsChangeEventHandler BeforeMarginsChange
Public Event BeforeMarginsChange As MarginsChangeEventHandler
The BeforeMarginsChange event's data class is MarginsChangeEventArgs. The following properties provide information specific to this event:
| Property | Description |
|---|---|
| Side | Gets changed page margins. |
| Value | Gets or sets the changed margin size in hundredths of an inch. |
When this event occurs, the MarginsChangeEventArgs.Value contains the changed margin size. You can change it back to an appropriate value if necessary.
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:
using DevExpress.XtraPrinting;
// ...
private void printingSystem1_BeforeMarginsChange(object sender,
MarginsChangeEventArgs e) {
if (e.Value != 100) e.Value = 100;
}
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