当前路径:GridPrinter.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CamtasiaStudio { using System; using System.Text; using System.Collections; using System.Collections.Generic; using System.Drawing; using System.Drawing.Printing; using System.Data; using System.Windows.Forms; public class GridPrinter { // the grid to print private DataGridView dataGridView; // the PrintDocument private PrintDocument printDocument; // center printout? private bool centerOnPage; // has a title? private bool hasTitle; // title private string title; // font private Font titleFont; // title color private Color titleColor; // use paging? private bool paging; // row printing static int currentRow; // page printing static int pageNumber; // page width private int pageWidth; // page height private int pageHeight; // left margin private int leftMargin; // top margin private int topMargin; // right margin private int rightMargin; // bottom margin private int bottomMargin; // y location placeholder private float currentY; // grid sizes private float rowHeaderHeight; private List<float> rowsHeight; private List<float> columnsWidth; private float dataGridViewWidth; // column stop points private List<int[]> mColumnPoints; private List<float> mColumnPointsWidth; private int mColumnPoint; public GridPrinter(DataGridView objDataGridView, PrintDocument objPrintDocument, bool bCenterOnPage, bool bHasTitle, string sTitle, Font objTitleFont, Color objTitleColor, bool bPaging) { dataGridView = objDataGridView; printDocument = objPrintDocument; centerOnPage = bCenterOnPage; hasTitle = bHasTitle; title = sTitle; titleFont = objTitleFont; titleColor = objTitleColor; paging = bPaging; pageNumber = 0; rowsHeight = new List<float>(); columnsWidth = new List<float>(); mColumnPoints = new List<int[]>(); mColumnPointsWidth = new List<float>(); if (!printDocument.DefaultPageSettings.Landscape) { pageWidth = printDocument.DefaultPageSettings.PaperSize.Width; pageHeight = printDocument.DefaultPageSettings.PaperSize.Height; } else { pageHeight = printDocument.DefaultPageSettings.PaperSize.Width; pageWidth = printDocument.DefaultPageSettings.PaperSize.Height; } leftMargin = printDocument.DefaultPageSettings.Margins.Left; topMargin = printDocument.DefaultPageSettings.Margins.Top; rightMargin = printDocument.DefaultPageSettings.Margins.Right; bottomMargin = printDocument.DefaultPageSettings.Margins.Bottom; currentRow = 0; } // calculate pri...
完整源码文件,请先购买后再查看
相关源码
- 餐馆点餐系统2022-06-13
- 学生管理系统——基础入门版2022-06-04
- 基于OOP设计新体育彩票选号器2022-05-28
- 密码管理器(1PASSWORD)2022-05-06
- 飞行棋小游戏2022-05-06
- 超市积分管理系统2022-04-28
关于我们 | 顾问团队 | 发展历程 | 联系我们 | 源码上传
联系电话(Tel):4008-010-151(免长途)
地址:北京市海淀区大恒科技大厦五层 邮编:100080
Floor 5th,Daheng Building,Zhongguancun,Beijing,China,100080
51Aspx.com 版权所有 CopyRight © 2006-2022. 京ICP备09089570号 | 京公网安备11010702000869号
联系电话(Tel):4008-010-151(免长途)
地址:北京市海淀区大恒科技大厦五层 邮编:100080
Floor 5th,Daheng Building,Zhongguancun,Beijing,China,100080
51Aspx.com 版权所有 CopyRight © 2006-2022. 京ICP备09089570号 | 京公网安备11010702000869号