【发布时间】:2015-12-07 13:13:43
【问题描述】:
如何打印多页?在我的表单中,我有带有相应标签的文本框,例如。 (id、name、course 等)但问题是 1 页不足以显示所有文本框。我必须添加另一个页面以显示带有标签的剩余文本框。我尝试将 e.hasmorepages 设置为 true,但第二页中出现的文本框与第一页相同,它不会继续。
这是我的代码:
Private Sub printSisDoc_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles printSisDoc.PrintPage
Dim labelFont As New Font("Arial", 11, FontStyle.Bold)
Dim textFont As New Font("Arial", 11, FontStyle.Regular)
Dim headerFont As New Font("Arial", 12, FontStyle.Bold)
e.Graphics.DrawString(lblGrade.Text, headerFont, Brushes.Black, 650, 660)
e.Graphics.DrawString(grade11.Text, textFont, Brushes.Black, 660, 690)
e.Graphics.DrawString(underline.Text, labelFont, Brushes.Black, 643, 692)
e.Graphics.DrawString(grade12.Text, textFont, Brushes.Black, 660, 715)
e.Graphics.DrawString(grade13.Text, textFont, Brushes.Black, 660, 740)
e.Graphics.DrawString(grade14.Text, textFont, Brushes.Black, 660, 765)
e.Graphics.DrawString(grade15.Text, textFont, Brushes.Black, 660, 790)
e.Graphics.DrawString(grade16.Text, textFont, Brushes.Black, 660, 815)
e.Graphics.DrawString(grade17.Text, textFont, Brushes.Black, 660, 840)
e.Graphics.DrawString(grade18.Text, textFont, Brushes.Black, 660, 865)
e.Graphics.DrawString(grade19.Text, textFont, Brushes.Black, 660, 890)
e.Graphics.DrawString(grade20.Text, textFont, Brushes.Black, 0, 1500)
mPageNumber += 1
e.HasMorePages = (mPageNumber <= 2)
End Sub
【问题讨论】:
标签: vb.net printing printdocument