H
htcting
Guest
Imports System.Drawing.Printing
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim b As Barcodes.Barcode39 = New Barcodes.Barcode39()
Dim img As Image
b.ShowString = chkShowText.Checked
b.TextFont = New Font("Time New Roman", 9)
img = b.GenerateBarcodeImage(PB.Width, PB.Height, TextBox1.Text)
PB.Image = img
End Sub
'print
Private Sub btnprint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnprint.Click
If PrintPreviewDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
PrintPreviewDialog1.Document.Print()
End If
End Sub
Dim pageNumber As Integer = 1
Dim numberOfPages As Integer = 1
Dim i As Integer = 0
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
End Sub
Private Sub Preview_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Preview.Click
PrintPreviewDialog1 = New PrintPreviewDialog()
PrintPreviewDialog1.Document = PrintDocument1
PrintPreviewDialog1.Show()
End Sub
Private Sub PrintPreviewDialog1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PrintPreviewDialog1.Load
End Sub
End Class
Continue reading...
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim b As Barcodes.Barcode39 = New Barcodes.Barcode39()
Dim img As Image
b.ShowString = chkShowText.Checked
b.TextFont = New Font("Time New Roman", 9)
img = b.GenerateBarcodeImage(PB.Width, PB.Height, TextBox1.Text)
PB.Image = img
End Sub
Private Sub btnprint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnprint.Click
If PrintPreviewDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
PrintPreviewDialog1.Document.Print()
End If
End Sub
Dim pageNumber As Integer = 1
Dim numberOfPages As Integer = 1
Dim i As Integer = 0
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
End Sub
Private Sub Preview_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Preview.Click
PrintPreviewDialog1 = New PrintPreviewDialog()
PrintPreviewDialog1.Document = PrintDocument1
PrintPreviewDialog1.Show()
End Sub
Private Sub PrintPreviewDialog1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PrintPreviewDialog1.Load
End Sub
End Class
Continue reading...