关于打印的问题 http://dev.csdn.net/develop/article/43/43707.shtmhttp://dev.csdn.net/develop/article/38/38695.shtm学习一下吧 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 打印 DataGrid (Visual C#)此示例说明如何打印 DataGrid 控件。示例private void printGrid_Click(System.Object sender, System.EventArgs e){ printDocument1.Print();}private void printDocument1_PrintPage(System.Object sender, System.Drawing.Printing.PrintPageEventArgs e){ PaintEventArgs myPaintArgs = new PaintEventArgs(e.Graphics, new Rectangle(new Point(0, 0), this.Size)); this.InvokePaint(dataGrid1, myPaintArgs);}编译代码本示例需要: 名为 printGrid 且含有 Click 事件处理程序的按钮控件。 名为 dataGrid1 的 DataGrid 控件。 名为 printDocument1 且包含 PrintPage 事件处理程序的 PrintDocument 组件。 可靠编程以下情况可能会导致异常: 您没有访问该打印机的权限。 没有安装打印机。 安全性为了运行此示例,您必须具有访问打印机的权限。 如何才能画出如下线型效果? 服务层调用窗体控件 UserControl问题 寻求asp.net 2005专家级页面布局美工大师讲授经验和方法。 如何用C++代码解释C#中的foreach循环? C#串口接收数据 我在一个winform程序里用DataView的RowFilter筛选时用两个下划线代表两个字符,但是怎么筛选不出来的?? 求助!那位帮我看看这段代码哪里有问题? C#中有指针的概念吗? 请大虾告诉我学C#的进程 昨天重装了vc.net2003,结果出问题了! c#中能否使用C++编写的动态链接库?
此示例说明如何打印 DataGrid 控件。示例
private void printGrid_Click(System.Object sender, System.EventArgs e)
{
printDocument1.Print();
}
private void printDocument1_PrintPage(System.Object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
PaintEventArgs myPaintArgs = new PaintEventArgs(e.Graphics, new Rectangle(new Point(0, 0), this.Size));
this.InvokePaint(dataGrid1, myPaintArgs);
}
编译代码
本示例需要: 名为 printGrid 且含有 Click 事件处理程序的按钮控件。
名为 dataGrid1 的 DataGrid 控件。
名为 printDocument1 且包含 PrintPage 事件处理程序的 PrintDocument 组件。
可靠编程
以下情况可能会导致异常: 您没有访问该打印机的权限。
没有安装打印机。
安全性
为了运行此示例,您必须具有访问打印机的权限。