当im在表格1中时,如何引发表格2中打印页面的事件
Public Sub PrintDocument1_PrintPage_1(sender As Object, e As Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
Dim dm As New Bitmap(Me.Panel1.Width, Me.Panel1.Height)
Panel1.DrawToBitmap(dm, New Rectangle(0, 0, Me.Panel1.Width, Me.Panel1.Height))
e.Graphics.DrawImage(dm, 0, 0)
Dim aPS As New PageSetupDialog
aPS.Document = PrintDocument1
End Sub
我希望能够在这里提出这一事件
Public Sub printall()
If txtempname.Items.Count = 0 Then
MessageBox.Show("There is no Record to Print")
Else
For i = 0 To txtempname.Items.Count - 1
txtempname.SelectedIndex = i
getEmployeeInfo()
getattendance()
getDeductions()
getExtraDeductions()
getLoans()
calculate()
printallnote()
PrintPayslip.payslip()
'Raised PrintPage event here
PrintPayslip.print()
PrintPayslip.Close()
Next
End If
End Sub