登录
首页 » C# » C# 套打Demo

C# 套打Demo

于 2021-05-06 发布
0 246
下载积分: 1 下载次数: 0

代码说明:

套打Demo 【核心代码】using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Drawing.Printing;namespace Print_Demo{ public partial class Form1 : Form { public PrintDocument printDt = new PrintDocument(); //打印文档对象 Font printFont; //打印使用的字体 public Form1() { InitializeComponent(); } void printDt_PrintPage(object sender, PrintPageEventArgs e) { float pointX = 10; float pointY = 10; e.Graphics.DrawString("打印内容", new Font("宋体", 16F), Brushes.Black, pointX 60, pointY); e.Graphics.DrawLine(new Pen(Color.Black), pointX, pointY 26,pointX 300,pointY 26); e.Graphics.DrawString("打印内容", printFont, Brushes.Black, pointX, pointY 35); e.Graphics.DrawLine(new Pen(Color.Black), pointX, pointY 56, pointX 300, pointY 56); e.Graphics.DrawString("打印内容", printFont, Brushes.Black, pointX, pointY 65); e.Graphics.DrawLine(new Pen(Color.Black), pointX, pointY 86, pointX 300, pointY 86); e.Graphics.DrawString("打印内容", printFont, Brushes.Black, pointX, pointY 95); e.Graphics.DrawLine(new Pen(Color.Black), pointX, pointY 116, pointX 300, pointY 116); e.Graphics.DrawString("打印内容", printFont, Brushes.Black, pointX, pointY 125); e.Graphics.DrawLine(new Pen(Color.Black), pointX, pointY 146, pointX 300, pointY 146); e.Graphics.DrawString("打印内容", printFont, Brushes.Black, pointX, pointY 155); e.Graphics.DrawLine(new Pen(Color.Black), pointX, pointY 176, pointX 300, pointY 176); e.Graphics.DrawString("打印内容", printFont, Brushes.Black, pointX, pointY 185); e.Graphics.DrawLine(new Pen(Color.Black), pointX, pointY 206, pointX 300, pointY 206); e.Graphics.DrawString("检测结果", printFont, Brushes.Black, pointX, pointY 233); e.Graphics.DrawString("通过", new Font("宋体",22F,FontStyle.Bold), Brushes.Black, pointX 90, pointY 225); e.Graphics.DrawLine(new Pen(Color.Black), pointX, pointY 265, pointX 300, pointY 265); e.Graphics.DrawString("单位名称", printFont, Brushes.Black, pointX, pointY 275); } private void Form1_Load(object sender, EventArgs e) { printDt.PrintPage = new PrintPageEventHandler(printDt_PrintPage); printFont = new Font("宋体", 12F); } private void btnPrint_Click(object sender, EventArgs e) { //PrintDialog printDlg = new PrintDialog(); //printDlg.Document = printDt; //printDlg.AllowPrintToFile = true; //printDlg.AllowCurrentPage = true; //printDlg.AllowSelection = true; //printDlg.ShowDialog(); //printDlg.ShowDialog(); printDt.Print(); } private void btnLook_Click(object sender, EventArgs e) { PrintPreviewDialog printPreview = new PrintPreviewDialog(); printPreview.PrintPreviewControl.Document = printDt; printPreview.ShowDialog(this); } }}

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 解析
    解析
    2013-06-11下载
    积分:1
  • <赞>C# 超市管理系统源码
    功能齐全的超市管理系统,专门美化过UI 请先附加数据库,否则无法进入系统(默认拥有最高权限账户为经理,密码为admin  压缩包内有使用说明!
    2018-06-10下载
    积分:1
  • ASP.NET/C#教师评价系统--毕业设计
    学生评教:登录后系统自动出现学生班级和授课老师对应关系,可选择不同的授课教师进行评价和提建议。教师自评:教师根据评价指标体系进行自我评估和提出建议或意见。考评组:考评组可以选择不同的授课教师进行评价和提出教学建议。 管理员模块:自动进行评分数汇总、自动生成教师评价报表、锁定数据、增加用户和用户校验等
    2019-07-09下载
    积分:1
  • c#调用vc++的DLL 例子源码下载
    c#调用vc++的DLL 例子源码下载
    2015-03-20下载
    积分:1
  • C# 通过正则表达式 从网页中 提取Email 示例源码下载
    从网页中 提取Email
    2013-09-28下载
    积分:1
  • C# 微信读取用户列表 发图文消息实例
    C# 微信读取用户列表 发图文消息实例
    2014-04-19下载
    积分:1
  • C# Socket 客户端服务器通信demo(附源码)
    C# Socket 客户端服务器通信demo(附源码)
    2013-12-14下载
    积分:1
  • Finite Element Analysis Method Guide through ANSYS Workbench.pdf
    本书针对ANSYS公司的有限元分析平台Workbench ,详细介绍了软件的功能及应用。本书内容丰富且涉及领域较广,使读者在掌握软件操作的同时,也能掌握解决相关工程领域实际问题的思路与方法,并能自如地解决本领域所出现的问题。全书分为6篇,共26章,第1篇从有限元分析着手,讲解工程问题的数学物理方程及Workbench平台的基础应用知识;第2篇以基础范例为指导,讲解在Workbench平台中进行结构静力学分析、模态分析、谐响应分析、响应谱分析、随机振动分析及瞬态动力学分析;第3篇作为进阶部分,讲解接触分析、显式动力学分析、复合材料分析、疲劳分析及压电分析;第4篇以项目范例为指导,讲解稳态热力学分析、瞬态热力学分析、计算流体动力学分析、电场分析及磁场分析。本书配套资源中的第5篇作为高级应用篇,讲解结构优化分析、线性屈曲分析、APDL编程及声学分析等;第6篇主要讲解多物理场耦合分析,包括电磁耦合、流固耦合、振动噪声等。
    2021-05-06下载
    积分:1
  • C#控制雷赛驱动器定长运动
    C#控制雷赛驱动器定长运动
    2020-11-29下载
    积分:1
  • C#编写的tcp通讯助手
    【实例简介】C#编写的tcp通讯助手
    2021-11-10 00:35:56下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载