Private Sub BuildCode()
Dim barcode As String = TextBox1.Text + "%" + TextBox2.Text + "&" + TextBox6.Text + "*"
'TextBox3.Text = barcode
SfBarcode1.Text = barcode
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
BMP = New Bitmap(GroupBox1.Width, GroupBox1.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb)
'BMP.SetResolution(300, 300)
GroupBox1.DrawToBitmap(BMP, New Rectangle(0, 0, GroupBox1.Width, GroupBox1.Height))
Dim pd As New PrintDocument
Dim pdialog As New PrintDialog
AddHandler pd.PrintPage, (Sub(s, args)
args.Graphics.DrawImage(BMP, 0, 0)
args.HasMorePages = False
End Sub)
pdialog.ShowDialog()
pd.PrinterSettings.PrinterName = pdialog.PrinterSettings.PrinterName
pd.Print()
End Sub
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
BuildCode()
End Sub
When I assing value to syncfusion barcode control, it builds fine, it shows the barcode on form, but when I print instead of barcode is nothing. If i assign the value to a textbox control with a Code128 font it prints just fine.
What could it be?
'initialize the barcode control
Dim barcode As SfBarcode = New SfBarcode()
'set the barcode symbology type
barcode.Symbology = BarcodeSymbolType.Code128A
'set the input text
barcode.Text = TextBox1.Text
'export the barcode control as image
PictureBox1.Image = barcode.ToImage(PictureBox1.Size) |