c#.net打印表单无法正常工作 [英] c#.net print form not working properly
问题描述
我找不到任何与我的问题相关的帖子。
我有一个应用程序,其中有很多标签和文本框以及菜单条哪些内容新,打开,保存,打印选项。
编译我的应用程序后,当我点击打印它会显示我预览然后我可以打印但在第一次预览时,它向我显示只有标签和几个文本框的活动表单,并且第二次它向我显示相同的如果我继续这样,最后它显示我的活动形式与所有字段之后很多试验。
我无法理解代码中出现问题的位置。如果有人知道这个或者看过这样的问题,请帮助我。
I'm not able find any post related to my problem.
I have an application in which i have many labels and text-boxes and a menu strip which contents new,open,save,print options.
After compiling my application , when i click on print it'll show me preview and then i can make a print but in preview for first time it is showing me the active form with only labels and few text-boxes and for second time it is showing me the same if i continue like that finally it is showing me the active form with all the fields after many trials.
I'm unable to understand where is the problem occurring in the code.If anyone knows about this or have seen such problem please help me.
推荐答案
说真的吗?根本不要使用PrintForm:使用 PrintDocument类 [< a href =http://msdn.microsoft.com/en-us/library/system.drawing.printing.printdocument.aspxtarget =_ blanktitle =New Window> ^ ]。这是一项更多的工作,但它可以提供更好的结果,并且您可以完全控制打印的内容和位置。当你掌握它时,它非常简单。
这个链接包含一个简单的例子。
错别字 - OriginalGriff [/ edit]
Seriously? Don't use PrintForm at all: use the PrintDocument class[^] instead. It's a bit more work, but it gives a much better result, and you have total control over exactly what is printed and where. And it's pretty simple when you get the hang of it.
The link includes a simple example.
[edit]Typos - OriginalGriff[/edit]
这篇关于c#.net打印表单无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!