如何打印表单上显示的元素的内容 [英] How can I print the contents of the elements shown on the Form

查看:85
本文介绍了如何打印表单上显示的元素的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何打印(DataGridView和文本框和标签......等)上显示的元素的内容

How can I print the contents of the elements shown on the (DataGridView And Text Boxes and Labels ...... Etc)

推荐答案

首先,最恰当的方法是打印数据,而不是控件的形式。数据在屏幕上呈现的方式与应如何在纸上呈现的方式不同。在纸面上,您无法单击按钮或在 DataGridView 中选择一个单元格。一切都是通过课程 完成的:

https://msdn.microsoft.com/en-us/library/system.drawing.printing.printdocument%28v=vs.110%29。 aspx [ ^ ]。



如果你还想打印一个 DataGridView 表单,你可以找到很多解决方案:

http://www.codeproject.com/search.aspx?q=Print+DataGridView&doctypeid=1 [ ^ ],

< a href =http://www.codeproject.com/search.aspx?q=Print+Form&doctypeid=1> http://www.codeproject.com/search.aspx? q = Print + Form& doctypeid = 1 [ ^ ]。



-SA
First of all, most adequate approach is to print data, not forms of controls. The way the data is presented on screen is different from how it should be presented on paper. On paper, you cannot click on a Button or select a cell in DataGridView. Everything is done via the class :
https://msdn.microsoft.com/en-us/library/system.drawing.printing.printdocument%28v=vs.110%29.aspx[^].

If you still want to print an instance of DataGridView or Form, you can find a lot of solutions:
http://www.codeproject.com/search.aspx?q=Print+DataGridView&doctypeid=1[^],
http://www.codeproject.com/search.aspx?q=Print+Form&doctypeid=1[^].

—SA


这篇关于如何打印表单上显示的元素的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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