Page 1 of 1

BarCode Printing

PostPosted: Sat Mar 29, 2008 9:21 pm
by atifmushtaq(legacy member)
Sir,

I have use barcode in my application please tell me that how can I print this and also tell me that is it possible that the Printing of barcode in Datareport in Visual Basic 6
Thanks

Re: BarCode Printing

PostPosted: Mon Mar 31, 2008 10:27 am
by glitch (legacy member)
You can find the print code in the VB6 sample project. See code below:

Printer.ScaleMode = vbTwips ' set the printer scalemode to Twips
'Coordinates for PaintPicture method must now be in Twips.
'1 inch has 1440 Twips.

XMargin = (Printer.Width - Printer.ScaleWidth) / 2
YMargin = (Printer.Height - Printer.ScaleHeight) / 2

X = 1 * 1440 ' X position in 1 Inch
Y = 1 * 1440 ' Y position in 1 Inch

X = X - XMargin ' adjust for margins
Y = Y - YMargin ' adjust for margins
'Print the barcode directly to the printer, start at position X,Y
Printer.Print "Morovia Bar Code Activex Sample"
Printer.Print "Printing the barcode at X= 1 Inch, Y= 1 Inch"
Printer.PaintPicture MrvBarcode1.Picture, X, Y
'Eject the page...
Printer.EndDoc

Re: BarCode Printing

PostPosted: Mon Mar 31, 2008 1:46 pm
by atifmushtaq(legacy member)
Thank you but I Enter this code & when I order to print it say Variable not defiend

Please help me

Re: BarCode Printing

PostPosted: Mon Mar 31, 2008 3:27 pm
by glitch (legacy member)
Find out which variable is undefined.

Re: BarCode Printing

PostPosted: Tue Apr 01, 2008 10:18 pm
by atifmushtaq(legacy member)
" XMargin = "
Sir,

Please tell me where i put this code , in button or................

Please help me as soon as possible

Re: BarCode Printing

PostPosted: Wed Apr 02, 2008 10:54 am
by glitch (legacy member)
You can remove them, or define them as

Dim XMargin As Integer

Re: BarCode Printing

PostPosted: Thu Apr 03, 2008 10:00 pm
by atifmushtaq(legacy member)
Thank you now it will ok