how can i multiple barcode image in print preview and print it?
here is the code of mine:
Public Class Form1
Dim PrintDoc As Printing.PrintDocument = New Printing.PrintDocument()
Dim pd_PrintDialog As New PrintDialog
Private Sub TextBox1_TextChanged_1(sender As Object, e As EventArgs) Handles txtBarcode.TextChanged
picBarcode.BackgroundImage = Code128(txtBarcode.Text, "A")
End Sub
Private Sub PrintDocHandler(ByVal sender As Object, ByVal ev As Printing.PrintPageEventArgs)
ev.Graphics.DrawImage(picBarcode.BackgroundImage, nud_MarginH.Value, nud_MarginW.Value, nud_MarginWBrcode.Value, nud_MarginHBrcode.Value)
End Sub
Private Sub Preview_Click(sender As Object, e As EventArgs) Handles Preview.Click
AddHandler PrintDoc.PrintPage, AddressOf PrintDocHandler
pd_PrintDialog.PrinterSettings.Copies = nud_Count.Value
PrintPreviewDialog1.WindowState = FormWindowState.Maximized
PrintPreviewDialog1.Document = PrintDoc
PrintPreviewDialog1.PrintPreviewControl.Zoom = 1
PrintPreviewDialog1.PrintPreviewControl.AutoZoom = False
PrintPreviewDialog1.ShowDialog()
end sub
End Class
the code is work but it's only print one.