• 大小: 165KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-09
  • 语言: C#
  • 标签: 打印  c#  winform  net  窗体  

资源简介

打印winform窗体实例,源代码真实可靠,不能用你骂我吧

资源截图

代码片段和文件信息

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

namespace testPrint
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender EventArgs e)
        {
            DataTable dt = new DataTable();

            dt.Columns.Add(“id“);
            dt.Columns.Add(“name“);

            DataRow dr = dt.NewRow();

            for (int i = 0; i < 100; i++)
            {
                dr = dt.NewRow();
                dr[“id“] = “00“ + i.ToString();
                dr[“name“] = “姓名“ + i.ToString();

                dt.Rows.Add(dr);
            }

            this.dgvView.DataSource = dt;
        }

        private void btnPrint_Click(object sender EventArgs e)
        {
            PrintDGV.Print_DataGridView(this.dgvView);
        }

    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-07-31 16:35  testPrint\
     目录           0  2018-07-31 16:35  testPrint\Backup\
     目录           0  2018-07-31 16:35  testPrint\Backup\testPrint\
     文件        2906  2007-05-29 21:22  testPrint\Backup\testPrint\Form1.Designer.cs
     文件        1019  2007-05-29 22:38  testPrint\Backup\testPrint\Form1.cs
     文件        5814  2007-05-29 21:22  testPrint\Backup\testPrint\Form1.resx
     文件       18791  2007-05-29 23:26  testPrint\Backup\testPrint\PrintDGV.cs
     文件        1668  2007-05-29 22:56  testPrint\Backup\testPrint\PrintOptions.cs
     文件       11312  2007-05-29 22:17  testPrint\Backup\testPrint\PrintOptions.designer.cs
     文件       26424  2007-05-29 22:17  testPrint\Backup\testPrint\PrintOptions.resx
     文件         468  2007-05-29 21:06  testPrint\Backup\testPrint\Program.cs
     目录           0  2018-07-31 16:35  testPrint\Backup\testPrint\Properties\
     文件        1180  2007-05-29 21:06  testPrint\Backup\testPrint\Properties\AssemblyInfo.cs
     文件        2872  2007-05-29 21:06  testPrint\Backup\testPrint\Properties\Resources.Designer.cs
     文件        5612  2007-05-29 21:06  testPrint\Backup\testPrint\Properties\Resources.resx
     文件        1092  2007-05-29 21:06  testPrint\Backup\testPrint\Properties\Settings.Designer.cs
     文件         249  2007-05-29 21:06  testPrint\Backup\testPrint\Properties\Settings.settings
     文件        3638  2007-05-29 22:07  testPrint\Backup\testPrint\testPrint.csproj
     文件        1066  2007-05-29 21:06  testPrint\Backup\testPrint.sln
     文件       18432  2007-05-29 23:26  testPrint\Backup\testPrint.v11.suo
     文件        9594  2018-06-22 09:50  testPrint\UpgradeLog.xml
     文件       30854  2018-06-22 09:50  testPrint\UpgradeLog.htm
     目录           0  2018-07-31 16:35  testPrint\_UpgradeReport_Files\
     文件        2229  2018-06-22 09:50  testPrint\_UpgradeReport_Files\UpgradeReport.css
     文件       22214  2012-07-26 20:25  testPrint\_UpgradeReport_Files\UpgradeReport.xslt
     文件         397  2018-06-22 09:50  testPrint\_UpgradeReport_Files\UpgradeReport_Error.png
     文件         338  2018-06-22 09:50  testPrint\_UpgradeReport_Files\UpgradeReport_Information.png
     文件         381  2018-06-22 09:50  testPrint\_UpgradeReport_Files\UpgradeReport_Success.png
     文件         292  2018-06-22 09:50  testPrint\_UpgradeReport_Files\UpgradeReport_Warning.png
     目录           0  2018-07-31 16:35  testPrint\testPrint\
     文件        2906  2007-05-29 21:22  testPrint\testPrint\Form1.Designer.cs
............此处省略40个文件信息

评论

共有 条评论