1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
PrintDocument1.Print()
End Sub
Private Sub Button&_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button&.Click
Dim pd As PrintDocument = New PrintDocument
Dim dllg As New PrintPreviewDialog
dllg.Document = pd
dllg.ShowDialog()
End Sub
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs)
Handles PrintDocument1.PrintPage
Dim PArgs As PaintEventArgs
PArgs = New PaintEventArgs(e.Graphics, New Rectangle(Me.Panel1.Left, Me.Panel1.Top, Me.Panel1.Width, Me.Panel1.Height))
InvokePaint(Me.Panel1, PArgs)
End Sub |
Partager