如何打印多個頁面?在我的表格中,我有帶相應標籤的文本框。 (ID,名稱,課程等),但問題是1頁是不夠顯示所有文本框。我必須添加另一個頁面來顯示剩餘的文本框及其標籤。我嘗試將e.hasmorepages設置爲true,但第二頁中顯示的文本框與第一頁中的文本框不一樣。在vb.net中打印多個頁面
這裏是我的代碼:
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
[http://stackoverflow.com/questions/16945172/printing-multiple-pages-with-printdocument](http://stackoverflow.com/questions/16945172/printing-multiple-pages-with- printdocument) –