Environment.PageSetup Method

Defines the Page Setup.
Public Function PageSetup( _ 
Optional ByVal allowMargins As Boolean = false, _ 
Optional ByVal showDialog As Boolean = true, _ 
Optional ByVal defaultMargins As Nullable(Of Integer) = null, _ 
Optional ByVal paperSize As PaperSize = null, _ 
Optional ByVal landscape As Nullable(Of Boolean) = null _ 
) As Boolean
This language is not supported or no code example is available.
public bool PageSetup( 
bool allowMargins = false, 
bool showDialog = true, 
Nullable<int> defaultMargins = null, 
PaperSize paperSize = null, 
Nullable<bool> landscape = null 
)
This language is not supported or no code example is available.

Parameters

allowMargins
bool

When true, the margins section of the dialog box is enabled.

showDialog
bool

When true, the PageSetup dialog is shown.

defaultMargins
Nullable<int>

The default margins

paperSize
PaperSize

The paper size

landscape
Nullable<bool>

The orientation mode

Return Value

bool

True if the user has confirmed the settings.

Example
 
 PrinterSettings printerSettings = new PrinterSettings();
  IEnumerable<PaperSize> paperSizes = printerSettings.PaperSizes.Cast<PaperSize>();
  PaperSize sizeA4 = paperSizes.FirstOrDefault<PaperSize>(size => size.Kind == PaperKind.A4);					
This language is not supported or no code example is available.
 Dim printerSettings As PrinterSettings = New PrinterSettings()
 Dim paperSizes As IEnumerable(Of PaperSize) = printerSettings.PaperSizes.Cast(Of PaperSize)()
 Dim sizeA4 As PaperSize = paperSizes.FirstOrDefault(Of PaperSize)(Function(size) size.Kind = PaperKind.A4)					
This language is not supported or no code example is available.

.NET Framework

Supported in: 4.8

In this article

Definition