A
ahmeddc
Guest
hi
Use a class that generates and draws a barcode
I assign the values from the datagrid to the barcode drawing function
And the final function of drawing the code is
PictureBox.Image = Code128Rendering.MakeBarcodeImage("Name", "code", "num", "price", 2, True) 'explanation
It works without problems
I draw the barcode based on the selected row
I draw only one row
Private Sub PrintDocument2_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument2.PrintPage
Try
Dim indx As Integer
Dim picbarcod As New PictureBox
indx = DataGridView1.SelectedRows(0).Index
'PictureBox.Image = Code128Rendering.MakeBarcodeImage(Name, code, "num", "price", 2, True) explanation
picbarcod.Image = Code128Rendering.MakeBarcodeImage(DataGridView1(0, indx).Value.ToString(), DataGridView1(1, indx).Value.ToString(), DataGridView1(2, indx).Value.ToString(), DataGridView1(3, indx).Value.ToString(), 2, True)
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Private Sub bt_printpreview_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_printpreview.Click
PrintPreviewDialog1.Document = PrintDocument2
PrintPreviewDialog1.ShowDialog()
End Sub
Private Sub bt_printbarcode_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_printbarcode.Click
PrintDocument2.PrinterSettings.Copies = CInt(NUM_COPIES.Value)
PrintDocument2.Print()
End Sub
What I want is
Draw the barcode based on the row specified in the check box row check
And draw more of the code when examining more than one row or all rows with a check box
Continue reading...
Use a class that generates and draws a barcode
I assign the values from the datagrid to the barcode drawing function
And the final function of drawing the code is
PictureBox.Image = Code128Rendering.MakeBarcodeImage("Name", "code", "num", "price", 2, True) 'explanation
It works without problems
I draw the barcode based on the selected row
I draw only one row
Private Sub PrintDocument2_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument2.PrintPage
Try
Dim indx As Integer
Dim picbarcod As New PictureBox
indx = DataGridView1.SelectedRows(0).Index
'PictureBox.Image = Code128Rendering.MakeBarcodeImage(Name, code, "num", "price", 2, True) explanation
picbarcod.Image = Code128Rendering.MakeBarcodeImage(DataGridView1(0, indx).Value.ToString(), DataGridView1(1, indx).Value.ToString(), DataGridView1(2, indx).Value.ToString(), DataGridView1(3, indx).Value.ToString(), 2, True)
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Private Sub bt_printpreview_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_printpreview.Click
PrintPreviewDialog1.Document = PrintDocument2
PrintPreviewDialog1.ShowDialog()
End Sub
Private Sub bt_printbarcode_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_printbarcode.Click
PrintDocument2.PrinterSettings.Copies = CInt(NUM_COPIES.Value)
PrintDocument2.Print()
End Sub
What I want is
Draw the barcode based on the row specified in the check box row check
And draw more of the code when examining more than one row or all rows with a check box
Continue reading...