Spread Windows Forms 6.0 Product Documentation
Centering Property
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > PrintInfo Class : Centering Property


Glossary Item Box

Gets or sets how the printed page is centered.

Syntax

Visual Basic (Declaration) 
Public Property Centering As Centering
Visual Basic (Usage)Copy Code
Dim instance As PrintInfo
Dim value As Centering
 
instance.Centering = value
 
value = instance.Centering
C# 
public Centering Centering {get; set;}

Property Value

Centering setting that specifies the type of centering for the printed pages

Remarks

For more information about the options available for printing, , refer to Managing Printing.

Example

This example shows how to define the settings for customizing the printed page layout.
C#Copy Code
// Define the printer settings
FarPoint.Win.Spread.PrintInfo printset = new FarPoint.Win.Spread.PrintInfo();
FarPoint.Win.Spread.PrintMargin printmar = new FarPoint.Win.Spread.PrintMargin();

printmar.Left = 10;
printmar.Right = 10;
printmar.Top = 20;
printmar.Bottom = 40;

printset.Centering = FarPoint.Win.Spread.Centering.Both;
printset.FirstPageNumber = 1;
printset.Margin = printmar;
printset.Opacity = 60;
printset.Orientation = FarPoint.Win.Spread.PrintOrientation.Portrait;
printset.ShowBorder = false;
printset.ShowColor = false;
printset.ShowColumnHeader = FarPoint.Win.Spread.PrintHeader.Hide;
printset.ShowRowHeader = FarPoint.Win.Spread.PrintHeader.Hide;
printset.ShowGrid = true;
printset.ShowShadows = false;
printset.ZoomFactor = 2;

// Assign the printer settings to the sheet and print it
fpSpread1.Sheets[0].PrintInfo = printset;
fpSpread1.PrintSheet(0);
Visual BasicCopy Code
' Define the printer settings
Dim printset As New FarPoint.Win.Spread.PrintInfo()
Dim printmar As New FarPoint.Win.Spread.PrintMargin

printmar.Left = 10
printmar.Right = 10
printmar.Top = 20
printmar.Bottom = 40

printset.Centering = FarPoint.Win.Spread.Centering.Both
printset.FirstPageNumber = 1
printset.Margin = printmar
printset.Opacity = 60
printset.Orientation = FarPoint.Win.Spread.PrintOrientation.Portrait
printset.ShowBorder = False
printset.ShowColor = False
printset.ShowColumnHeader = FarPoint.Win.Spread.PrintHeader.Hide
printset.ShowRowHeader = FarPoint.Win.Spread.PrintHeader.Hide
printset.ShowGrid = True
printset.ShowShadows = False
printset.ZoomFactor = 2

' Assign the printer settings to the sheet and print it
FpSpread1.Sheets(0).PrintInfo = printset
FpSpread1.PrintSheet(0)

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.