• 大小: 3.8MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-09-10
  • 语言: C#
  • 标签: C#代码  

资源简介

C#期末大作用,当初做了几天,大家可以下载,混个积分,为了下载!谢谢

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Printing;

namespace StudentGrade_v2._0
{
    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 rowsHeight;
        private List columnsWidth;
        private float dataGridViewWidth;

        // column stop points
        private List mColumnPoints;
        private List 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();
            columnsWidth = new List();
            mColumnPoints = new List();
            mColumnPointsWidth = new List();
            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.Margin

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2015-01-15 17:52  50011200045 张启明\
     文件     2466816  2014-12-30 19:57  50011200045 张启明\C#实验报告 张启明 5001120045.doc
     目录           0  2015-01-15 17:52  50011200045 张启明\StudentGrade_v2.0\
     文件     3145728  2014-12-24 18:24  50011200045 张启明\StudentGrade_v2.0\db.student.mdf
     文件     1048576  2014-12-24 18:24  50011200045 张启明\StudentGrade_v2.0\db.student_1.ldf
     目录           0  2015-01-15 17:52  50011200045 张启明\StudentGrade_v2.0\StudentGrade_Setup\
     目录           0  2014-12-25 12:15  50011200045 张启明\StudentGrade_v2.0\StudentGrade_Setup\Debug\
     目录           0  2015-01-15 17:52  50011200045 张启明\StudentGrade_v2.0\StudentGrade_Setup\Release\
     文件      430592  2014-12-25 12:18  50011200045 张启明\StudentGrade_v2.0\StudentGrade_Setup\Release\setup.exe
     文件      771072  2014-12-25 12:18  50011200045 张启明\StudentGrade_v2.0\StudentGrade_Setup\Release\StudentGrade_Setup.msi
     文件       31406  2014-12-25 12:18  50011200045 张启明\StudentGrade_v2.0\StudentGrade_Setup\StudentGrade_Setup.vdproj
     目录           0  2015-01-15 17:52  50011200045 张启明\StudentGrade_v2.0\StudentGrade_v2.0\
     文件        1213  2014-12-25 12:18  50011200045 张启明\StudentGrade_v2.0\StudentGrade_v2.0.sln
     文件       63488  2014-12-30 08:59  50011200045 张启明\StudentGrade_v2.0\StudentGrade_v2.0.suo
     文件         239  2014-12-25 12:13  50011200045 张启明\StudentGrade_v2.0\StudentGrade_v2.0\App.config
     目录           0  2015-01-15 17:52  50011200045 张启明\StudentGrade_v2.0\StudentGrade_v2.0\bin\
     目录           0  2015-01-15 17:52  50011200045 张启明\StudentGrade_v2.0\StudentGrade_v2.0\bin\Debug\
     文件      194048  2014-12-24 17:40  50011200045 张启明\StudentGrade_v2.0\StudentGrade_v2.0\bin\Debug\StudentGrade_v2.0.exe
     文件         245  2014-12-23 22:44  50011200045 张启明\StudentGrade_v2.0\StudentGrade_v2.0\bin\Debug\StudentGrade_v2.0.exe.config
     文件      192000  2014-12-24 17:40  50011200045 张启明\StudentGrade_v2.0\StudentGrade_v2.0\bin\Debug\StudentGrade_v2.0.pdb
     文件       11600  2014-12-25 12:13  50011200045 张启明\StudentGrade_v2.0\StudentGrade_v2.0\bin\Debug\StudentGrade_v2.0.vshost.exe
     文件         245  2014-12-23 22:44  50011200045 张启明\StudentGrade_v2.0\StudentGrade_v2.0\bin\Debug\StudentGrade_v2.0.vshost.exe.config
     文件         490  2013-06-18 20:28  50011200045 张启明\StudentGrade_v2.0\StudentGrade_v2.0\bin\Debug\StudentGrade_v2.0.vshost.exe.manifest
     目录           0  2015-01-15 17:52  50011200045 张启明\StudentGrade_v2.0\StudentGrade_v2.0\bin\Release\
     文件      187904  2014-12-25 12:14  50011200045 张启明\StudentGrade_v2.0\StudentGrade_v2.0\bin\Release\StudentGrade_v2.0.exe
     文件         239  2014-12-25 12:13  50011200045 张启明\StudentGrade_v2.0\StudentGrade_v2.0\bin\Release\StudentGrade_v2.0.exe.config
     文件      157184  2014-12-25 12:14  50011200045 张启明\StudentGrade_v2.0\StudentGrade_v2.0\bin\Release\StudentGrade_v2.0.pdb
     文件       11600  2014-12-30 08:38  50011200045 张启明\StudentGrade_v2.0\StudentGrade_v2.0\bin\Release\StudentGrade_v2.0.vshost.exe
     文件         239  2014-12-25 12:13  50011200045 张启明\StudentGrade_v2.0\StudentGrade_v2.0\bin\Release\StudentGrade_v2.0.vshost.exe.config
     文件         490  2010-03-17 22:39  50011200045 张启明\StudentGrade_v2.0\StudentGrade_v2.0\bin\Release\StudentGrade_v2.0.vshost.exe.manifest
     文件       16543  2014-12-23 21:33  50011200045 张启明\StudentGrade_v2.0\StudentGrade_v2.0\GridPrinter.cs
............此处省略125个文件信息

评论

共有 条评论