将可滚动表格打印到A4页面 [英] Print A Scroalble Form To An A4 Page

查看:103
本文介绍了将可滚动表格打印到A4页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的代码是





My Code is


Imports Microsoft.VisualBasic.PowerPacks
Imports Microsoft.VisualBasic.PowerPacks.Printing.PrintForm.PrintOption
Public Class print_prectice
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
PrintForm2.PrintAction = Drawing.Printing.PrintAction.PrintToPreview
PrintForm2.Print(Me, PowerPacks.Printing.PrintForm.PrintOption.Scrollable)
End Sub

Private Sub PrintForm2_QueryPageSettings1(ByVal sender As Object, ByVal e As System.Drawing.Printing.QueryPageSettingsEventArgs) Handles PrintForm2.QueryPageSettings
Dim a As New System.Drawing.Printing.PaperSize("A4 (210 x 297 mm)", 827, 1169)
Dim ps As New Drawing.Printing.PageSettings
ps.PaperSize = a
ps.Landscape = False
ps.Margins.Top = 10
ps.Margins.Bottom = 10
ps.Margins.Left = 10
ps.Margins.Right = 10
e.PageSettings = ps
End Sub
End Class





我无法打印表格的隐形部分

但是已经使用过的



I Couldn't print the invisble part of the form
but a already used

PrintForm2.Print(Me, PowerPacks.Printing.PrintForm.PrintOption.Scrollable



那我应该怎么做抱着我



http://www.dreamincode.net/forums/uploads/monthly_10_2015/post-675878-144575354514.png [ ^ ]

推荐答案

简单:不要使用PrintForm!



相反,请使用 PrintDocument类 [ ^ ]允许你准确指定打印的位置。

看起来工作更难 - 而且更复杂 - 但是你得到了更好的结果,你可以打印所有数据。链接中有一个示例。
Simple: don't use PrintForm!

Instead, use the PrintDocument class[^] which allows you to specify exactly what is printed where.
It looks like a lot harder work - and it is more complicated - but you get a better result, and you can print all your data. There is an example in the link.


这篇关于将可滚动表格打印到A4页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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