在Windows应用程序中打印表单 [英] Printing a form in windows application

查看:59
本文介绍了在Windows应用程序中打印表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所有人都好,


我正在使用C#在Windows应用程序中做一个项目.我对打印帐单有疑问.我是否要设置宽度,确定票据是否像无保证金商店中的票据一样在小纸上打印?

Hai to all,


Am doing a project in windows application using c#. I have one doubt about printing the bill. Am i want to set width whether the bill is printing in a small paper like bills in margin free shop?

推荐答案

Aswathi, 如果要打印帐单,则可以使用Microsoft报告.
但是如果要打印表格,则非常简单.
转到Visual Studio的工具箱
> Visual Basic电源包
>将PrintForm组件拖动到表单
>在按钮单击事件上编写代码
Hi Aswat
If you want to print bill you can use Microsoft Reports.
but if you want to print Form then it is very easy.
Go to ToolBox of visual Studio
>Visual Basic Power Packs
>Drag PrintForm component to the form
>On button click event write the code
this.printForm1.Print();


,尽管您可以使用正如Uma Shankar Patel所建议的那样,Printform组件可能不是最佳解决方案-使用 ^ ]类.优势在于它是面向文档的,而不是面向显示/GUI的,这意味着您可以更好地控制账单的打印方式,并且通常可以更好地控制质量.使用起来稍微复杂一些,但没有很多,并且该链接提供了一个简单的示例.
While you can use a Printform component as Uma Shankar Patel suggests, it may not be the best solution - look at using a PrintDocument[^] class instead. The advantage is that it is document oriented, rather than display / GUI oriented which means you get better control over exactly how your bill prints, and normally much better quality. It is a little more complex to use, but not a lot, and the link provides a simple example.


这篇关于在Windows应用程序中打印表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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