バージョン

MarginTop プロパティ

PrintDocument の上マージンの値を返します(読み取り専用)。UltraGrid.InitializePrintPreview および UltraGrid.InitializePrint イベントでマージンを設定できます。
シンタックス
'宣言
 
Public ReadOnly Property MarginTop As Integer
public int MarginTop {get;}
解説

このプロパティは読み取り専用です。関連するイベント引数の PrintDocument の DefaultPageSetting の Margins プロパティを使用して、UltraGrid.InitializePrint および UltraGrid.InitializePrintPreview イベントでマージンを設定できます。これは、マージンをページ単位で変更できないという意味です。

使用例
Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid
Imports System.Diagnostics

   Private Sub UltraGrid1_InitializeLogicalPrintPage(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.CancelableLogicalPrintPageEventArgs) Handles ultraGrid1.InitializeLogicalPrintPage

       Debug.WriteLine("e.Collate = " & e.Collate.ToString())
       Debug.WriteLine("e.Copies = " & e.Copies.ToString())
       Debug.WriteLine("e.DocumentName = " & e.DocumentName)
       Debug.WriteLine("e.Landscape = " & e.Landscape)
       Debug.WriteLine("e.LogicalPageNumber = " & e.LogicalPageNumber)
       Debug.WriteLine("e.DocumentName = " & e.MarginBottom)
       Debug.WriteLine("e.DocumentName = " & e.MarginLeft)
       Debug.WriteLine("e.DocumentName = " & e.MarginRight)
       Debug.WriteLine("e.DocumentName = " & e.MarginTop)
       Debug.WriteLine("e.DocumentName = " & e.PaperHeight)
       Debug.WriteLine("e.DocumentName = " & e.PaperWidth)
       Debug.WriteLine("e.DocumentName = " & e.PrintColors)
       Debug.WriteLine("e.DocumentName = " & e.PrinterName)
       Debug.WriteLine("e.DocumentName = " & e.PrintRange)
       Debug.WriteLine("e.DocumentName = " & e.DocumentName)

       ' You can also setup the footer and header on a per page basis.
       e.LogicalPageLayoutInfo.PageHeader = "Page Title"
       e.LogicalPageLayoutInfo.PageHeaderAppearance.ForeColor = Color.DarkGray

       e.LogicalPageLayoutInfo.PageFooter = "Page Footer Text"
       e.LogicalPageLayoutInfo.PageFooterAppearance.TextHAlign = HAlign.Center

       ' Following code cancels the event to prevent prevewing or printing more than 10 pages.
       If e.LogicalPageNumber > 10 Then
           e.Cancel = True
       End If

   End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;

private void ultraGrid1_InitializeLogicalPrintPage(object sender, Infragistics.Win.UltraWinGrid.CancelableLogicalPrintPageEventArgs e)
{

	Debug.WriteLine( "e.Collate = " + e.Collate.ToString( ) );
	Debug.WriteLine( "e.Copies = " + e.Copies.ToString( ) );
	Debug.WriteLine( "e.DocumentName = " + e.DocumentName  );
	Debug.WriteLine( "e.Landscape = " + e.Landscape );
	Debug.WriteLine( "e.LogicalPageNumber = " + e.LogicalPageNumber );
	Debug.WriteLine( "e.DocumentName = " + e.MarginBottom );
	Debug.WriteLine( "e.DocumentName = " + e.MarginLeft );
	Debug.WriteLine( "e.DocumentName = " + e.MarginRight );
	Debug.WriteLine( "e.DocumentName = " + e.MarginTop );
	Debug.WriteLine( "e.DocumentName = " + e.PaperHeight );
	Debug.WriteLine( "e.DocumentName = " + e.PaperWidth );
	Debug.WriteLine( "e.DocumentName = " + e.PrintColors );
	Debug.WriteLine( "e.DocumentName = " + e.PrinterName );
	Debug.WriteLine( "e.DocumentName = " + e.PrintRange );
	Debug.WriteLine( "e.DocumentName = " + e.DocumentName  );

	// You can also setup the footer and header on a per page basis.
	e.LogicalPageLayoutInfo.PageHeader = "Page Title";
	e.LogicalPageLayoutInfo.PageHeaderAppearance.ForeColor = Color.DarkGray;
			
	e.LogicalPageLayoutInfo.PageFooter = "Page Footer Text";
	e.LogicalPageLayoutInfo.PageFooterAppearance.TextHAlign = HAlign.Center;

      // Following code cancels the event to prevent prevewing or printing more than 10 pages.
	if ( e.LogicalPageNumber > 10 )
		e.Cancel = true;

}
参照