'宣言 Public Delegate Sub InitializeLogicalPrintPageEventHandler( _ ByVal sender As Object, _ ByVal e As CancelableLogicalPrintPageEventArgs _ )
public delegate void InitializeLogicalPrintPageEventHandler( object sender, CancelableLogicalPrintPageEventArgs e )
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; }