Printing Copies [Resolved]
I am just angry:mad:
I have been looking all over **** for the correct way to do this, and found NOTHING!!
Please help!
This is my code:
Code:
Private Sub printboards()
AddHandler pd1.PrintPage, AddressOf pd1_PrintPage
pd1.PrinterSettings.Copies = PrintDialog1.PrinterSettings.Copies
pd1.Print()
End Sub
Private Sub btnPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrint.Click
PrintDialog1.Document = pd1
If PrintDialog1.ShowDialog = DialogResult.OK Then
printboards()
End If
End Sub
Private Sub pd1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles pd1.PrintPage
e.Graphics.Clear(Color.White)
Dim x1 As Integer
Dim y1 As Integer
Dim x2 As Integer
Dim y2 As Integer
Dim left As Integer
Dim horz As Integer
Dim top1 As Integer = 200
Dim vert As Integer
For vert = 0 To 2
For horz = 0 To 1
e.Graphics.DrawString("Week " & week + 1, New Font("Arial", 12, FontStyle.Bold), Brushes.Red, 70 + left, top1)
Dim ctl As Control
For Each ctl In Me.Controls
If TypeOf ctl Is Label Then
Dim lbl As Label = ctl
e.Graphics.DrawString(lbl.Text, New Font("Arial", 8, FontStyle.Regular), Brushes.Black, lbl.Left + 50 + left, lbl.Top + top1)
End If
Next
For Each ctl In Me.Controls
If TypeOf ctl Is TextBox Then
Dim txt As TextBox = ctl
e.Graphics.DrawString(txt.Text, New Font("Arial", 9, FontStyle.Bold), Brushes.Blue, txt.Left + 55 + left, txt.Top + top1)
End If
Next
week = week + 1
Me.btnRegen.PerformClick()
left = left + 400
Next
left = 0
Me.btnRegen.PerformClick()
top1 = top1 + 300
pagecount += 1
Next
If pagecount = 3 Then
e.HasMorePages = True
ElseIf pagecount = 6 Then
e.HasMorePages = True
Else
e.HasMorePages = False
week = 0
pagecount = 0
End If
End Sub
What am I missing in order to print multiple copies?
:(
Any Help Would Be Greatly Appriciated