打印代码
来源:互联网 发布:国信金太阳软件下载 编辑:程序博客网 时间:2024/06/05 15:21
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Printing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
PrintDocument pd = new PrintDocument();
pd.PrintPage += new PrintPageEventHandler(pd_PrintPage);
//if (this.storePageSettings != null)
//{
// pd.DefaultPageSettings = this.storePageSettings;
//}
PrintDialog dlg = new PrintDialog();
dlg.Document = pd;
if (dlg.ShowDialog() == DialogResult.OK)
{
pd.Print();
}
}
void pd_PrintPage(object sender, PrintPageEventArgs e)
{
Graphics g = e.Graphics;
PaintDocument(g);
e.HasMorePages = false;
}
/// <summary>
/// 打印输出定位
/// </summary>
/// <param ></param>
private void PaintDocument(Graphics g)
{
g.PageUnit = GraphicsUnit.Point;
//出口口岸
g.DrawString("订单打印测试", new Font("Arial",42,FontStyle.Bold), Brushes.Black, new Point(0, 500));//POINT定位
}
}
}
- 打印代码
- Web打印代码
- WEB打印代码大全
- DevExpress打印相关代码
- WEB打印代码大全
- ie打印代码
- 网页打印代码
- 文章复制打印代码
- spread 打印示例代码
- 客户端 打印代码
- DevExpress打印相关代码
- JAVA打印代码
- WEB打印代码大全
- WEB打印代码大全
- 网页打印代码
- c#打印设置代码
- JavaScript分页打印代码
- web页面打印代码
- 利用单向环链表解决约瑟夫问题
- 浅析递归
- jQuery选择器 – 可见度过滤(Visibility Filters)
- 有符号数在内存中是以其补码的形式存在的【如何求一个负数的补码】
- mkcephfs 使用
- 打印代码
- java类加载器(二)
- eclipse JavaHL安装问题
- jQuery选择器 – 层次(Hierarchy)
- Listener已启动,本地可以连接数据库,远程pl/sql工具连接报ora-12541监听不存在错误
- c#给用户控件添加事件处理程序
- jQuery选择器 – 基本(Basics)
- [自己写的]淘宝分布式存储系统-TFS的nginx模块与py接口
- jQuery选择器(Selectors)