ArcGISCompare.frmMappings.pDoc_PrintPage C# (CSharp) Метод

pDoc_PrintPage() приватный Метод

private pDoc_PrintPage ( object sender, System.Drawing.Printing.PrintPageEventArgs e ) : void
sender object
e System.Drawing.Printing.PrintPageEventArgs
Результат void
        private void pDoc_PrintPage(object sender, PrintPageEventArgs e)
        {
            int charactersOnPage = 0;
              int linesPerPage = 0;

              if (PrintedSection == "") { PrintedSection = TheOutput; }
              // Sets the value of charactersOnPage to the number of characters
              // of stringToPrint that will fit within the bounds of the page.
              e.Graphics.MeasureString(PrintedSection, this.Font,
              e.MarginBounds.Size, StringFormat.GenericTypographic,
              out charactersOnPage, out linesPerPage);

              // Draws the string within the bounds of the page
              e.Graphics.DrawString(PrintedSection, this.Font, Brushes.Black,
              e.MarginBounds, StringFormat.GenericTypographic);

              // Remove the portion of the string that has been printed.
              PrintedSection = PrintedSection.Substring(charactersOnPage);

              // Check to see if more pages are to be printed.
              e.HasMorePages = (PrintedSection.Length > 0);
        }