在C#中形成高级打印 [英] Advanced print to form in C#

查看:72
本文介绍了在C#中形成高级打印的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在C#windows应用程序中打印表单时,我想使表单大小与纸张大小相匹配,以便所有表单都显示在纸张上,还有如何显示某些控件而其他控件不显示在打印页面上。

我使用Visual Studio 2012,



我会非常感谢你的帮助。



我在表单中添加了 PrintForm 控件并编写了以下代码:

When printing a form in C# windows application I would like to make the form size matches the paper size so that all the form appears on the paper, also how to make some controls appear and others not appear on the print page.
I use Visual Studio 2012,

I would value your help.

I added PrintForm control to the form and wrote the following code:

private void btnPrint_Click(object sender, EventArgs e)
       {

           this.printForm1.Print(this,  Microsoft.VisualBasic.PowerPacks.Printing.PrintForm.PrintOption.FullWindow);
       }

推荐答案

不要打印表格:它永远不会好看。



相反,请使用 PrintDocument [ ^ ] - 它使您可以完全控制打印操作以及打印的位置。
Don't print the form: it never looks good.

Instead, use a PrintDocument[^] - it gives you complete control over the print operation and what is printed where.


浏览扩展C#PrintDialog - 第一部分 [ ^ ]。


这篇关于在C#中形成高级打印的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆