VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Barcode 3 of 9 generator

Fernando Sola  (1 Submission)   Miscellaneous   Visual Basic 3.0   Intermediate   Wed 3rd February 2021

Create a 3 of 9 bar code without using a TTF, DLL or OCX.

Inputs
A String (sToCode) with the data you want to use for the bar code. 'A PictureBox (pPaintInto) object where the code will draw the bar code. 'A Label (pLabelInto) object where the code will put the human readable data.

Assumes
You should have a Label control and a PictureBox control in your Form before running this code. This controls will be passed as parameters to the Sub. 'Example: Code3of9 "123-ABC", Picture1, Label1 'I see bar codes as a binary graphic since each "bar coded" character has a 16 pixels fixed width. Actually the standard says that the codes have 9 positions from which 3 of them are wide. Each position is either a bar or a space and between each character there is a narrow space. I added the space as part of the character. 'The sValidCodes string has all the valid characters bar codes coded into decimal numbers so every character uses 5 digits from the string. For example, the "*" character uses the last 5 digits from the string (35770) which would be: '1000101110111010 in a binary way. Whenever there is a one, this code will draw a line in the propper position of the PictureBox control. 'I created this code to print the bar code that a friend uses in his frequent customer cards. He used to print them with several True Type Fonts and he was having a lot of trouble reading them with a (very) cheap bar code scanner. I developped this code originally for Excel but it has been changed to work perfectly in Visual Basic. 'If any one of you can test it in earlier versions of VB (4 or earlier) I would really appreciate your comments about how it works (if it works of course). 'And at the end but not less important please let me know what you think about it with your comments and/or score. I really appreciate that to know how I am doing with my development skills/knowledge.

Returns
Nothing

Rate Barcode 3 of 9 generator (22(22 Vote))
Barcode 3 of 9 generator.bas

Barcode 3 of 9 generator Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters