タイトル : Re^3: PrintDocument−改頁について 投稿日 : 2004/12/29(Wed) 18:22 投稿者 : 花ちゃん
一応下記のような設定で複数ページを印刷できますが?。 Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button1.Click PrintPreviewDialog1.Document = PrintDocument1 PrintPreviewDialog1.ShowDialog() End Sub Private prpg As Integer Private count As Integer Private pgMax As Integer = 50 Private Sub PrintDocument1_PrintPage(ByVal sender As Object, _ ByVal e As System.Drawing.Printing.PrintPageEventArgs) _ Handles PrintDocument1.PrintPage Dim g As Graphics = e.Graphics Dim i As Integer g.PageUnit = GraphicsUnit.Millimeter Select Case prpg Case 0 For i = 1 To 10 g.DrawString("あいうえお", _ New Font("MS Pゴシック", 12), Brushes.Black, 20, i * 10) count += 1 Next i e.HasMorePages = True Case 1 e.HasMorePages = False For i = 1 To pgMax - count g.DrawString("かきくけこ", _ New Font("MS Pゴシック", 12), Brushes.Black, 20, i * 10) Next i End Select If ((pgMax - count) / 10) > 1 Then prpg = 0 Else prpg = 1 End If End Sub |