   Help for BarCod

BarCod is a Visual Basic custom control that displays a bar code.

Registration Information

Order Form

Getting Custom Controls Written

Properties

Events


Events

BarCod supports two events: Click and DblClick.


Properties

BarCod uses the Caption property to determine what to display.  ForeColor is used for the color of the bars, BackColor is used for the color of the background.  If BarCod cannot fit the entire bar code in the control window, it will fill the entire control with the background color.

Under VB3, BarCod will bind to a data control.  It uses the DataField, DataSource, and DataChanged properties.  See your VB manual for more information.

BarCod has the following custom properties:

BarWidth

Direction

Displayed

PrinterHDC

PrinterHeight

PrinterLeft

PrinterScaleMode

PrinterTop

PrinterWidth

Style


BarWidth Property

Description

Determines the width the bars in the bar code.

Usage

[form.][label.]BarWidth[ = width%]

Remarks

This is represents the width of the "narrow" bar in the code selected (see Style).  If this is set to 0, BarCod expands the bar code to fit in the control.

Data Type

Integer


Direction Property

Description

Determines the direction/orientation of the bar code.

Usage

[form.][label.]Direction[ = direction%]

Remarks

The value of this property determines what direction the bar code goes.  This property can be one of the four following values:

Value	Description

0	Left-to-right

1	Right-to-left

2	Top-to-bottom

3	Bottom-to-top

Data Type

Integer


Displayed Property

Description

Returns the actual string displayed in the bar code.

Usage

[form.][label.]Displayed[ = displayed$]

Remarks

This property holds what was actually displayed.  Bar codes don't have all the characters available.  Some are purely numeric, some have numbers and letters, etc.  This property lets the program know what was actually displayed.

Data Type

String


PrinterHDC Property

Description

Causes the barcode to be painted in the device handle specified.

Usage

[form.][label.]PrinterHDC[ = hdc%]

Remarks

When this property is set, BarCod paints itself into the Windows device context specified.  Normally, this is used to print the barcode.  The Printer Object (see your VB manuals) has a property name hDC.

To print a barcode, make sure the caption property is set correctly.  Then, set the PrinterHeight, PrinterLeft, PrinterTop, PrinterWidth, and PrinterScaleMode properties.  Finally, set the PrinterHDC equal to Printer.hDC.

For code samples, see BSAMPLE2 in the samples file.

Data Type

Integer


PrinterHeight, PrinterLeft, PrinterTop, and PrinterWidth Properties

Description

Describes the area in which to paint the barcode.

Usage

[form.][label.]PrinterHeight[ = height%]

[form.][label.]PrinterLeft[ = left%]

[form.][label.]PrinterTop[ = top%]

[form.][label.]PrinterWidth[ = width%]

Remarks

These properties describe where to place the barcode when printing.  The coordinates used should be in the units specified by the PrinterScaleMode property.

To print a barcode, make sure the caption property is set correctly.  Then, set the PrinterHeight, PrinterLeft, PrinterTop, PrinterWidth, and PrinterScaleMode properties.  Finally, set the PrinterHDC equal to Printer.hDC.

For code samples, see BSAMPLE2 in the samples file.

Data Type

Integer


PrinterScaleMode Property

Description

Determines the units of measurement used by the PrinterHeight, PrinterLeft, PrinterTop, and PrinterWidthproperties.

Usage

[form.][label.]PrinterScaleMode[ = mode%]

Remarks

This property determines what units to use for the properties describing the area to print in.  This property can be one of:

Value	Description

0	Pixel (default, smallest unit of printer resolution)

1	Twip (1440 twips per inch)

2	Point (72 points per inch)

3	Pixel (smallest unit of printer resolution)

4	Character (12 per inch horizontally, 6 per inch vertically)

5	Inch

6	Millimeter

7	Centimeter

To print a barcode, make sure the caption property is set correctly.  Then, set the PrinterHeight, PrinterLeft, PrinterTop, PrinterWidth, and PrinterScaleMode properties.  Finally, set the PrinterHDC equal to Printer.hDC.

For code samples, see BSAMPLE2 in the samples file.

Data Type

Integer


Style Property

Description

Determines what bar code style is used.

Usage

[form.][label.]Style[ = style%]

Remarks

This property determines the style of bar code used.  Each style has a different set of characterts that it supports.  The styles are:

Value	Description

0	None

1	2 of 5 - numbers only

2	Interleaved 2 of 5 - numbers only

3	3 of 9 - numbers, upper case letters, and  - . * $ / + %

4	Codabar (rationalized) - numbers, and A B C D - $ : / . +

Data Type

Integer


 BarCod Order Form

Use the Print Topic... command from the File menu to print this order form.

Mail this	James Shields

form to:	Mabry Software

Post Office Box 31926

Seattle, WA  98103-1926

Fax: 206-632-0272

CompuServe: 71231,2066

Internet: mabry@halcyon.com

MAKE CHECKS AND MONEY ORDERS OUT TO: James Shields

Where did you get this copy of BarCod?

_______________________________________________________________

Ship to:	_______________________________________________________________

_______________________________________________________________

_______________________________________________________________

_______________________________________________________________

_______________________________________________________________

Phone:	_____________________________

Fax:	_____________________________

CompuServe:	_____________________________

Internet:	_____________________________

qty ordered	_____	REGISTRATION

$15 each, postpaid (check or money order in hard currency).  Foreign addressed add $2.00 shipping.  No additional shipping charges to Canada or Mexico.

qty ordered	_____	SOURCE CODE AND REGISTRATION

$45 each, postpaid  (check or money order in hard currency).  Foreign addresses add $5.00 shipping.  No additional shipping charge to Canada.


About BarCod

BarCod was written by James Shields.  Inquiries can be sent to 71231,2066 on CompuServe, or mabry@halcyon.com on Internet.  If you must send something via U.S. Mail, the address is:

James Shields

Mabry Software

P.O. Box 31926

Seattle, WA  98103-1926

You can register this program by sending $15 and your address (international orders should send the equivalent of $17 in hard currency).  CompuServe members may register by sending $10 and their account number (the registered version will be E-mailed to you).  CompuServe members may also register this package by going to the SWREG forum.  BARCOD is registered there.  Its registration ID is 1314.

Source code to this control is available for $45 ($50 for international orders).  With source code you get a registered version of the control.  If you are a CompuServe member, you may get the source code in the Software Registration forum (GO SWREG) for $40.  Its registration number is 1315.

(C) Copyright 1993 by James Shields


Getting Custom Controls Written

If you or your organization would like to have custom controls written, contact either me or Zane Thomas (co-author of the Waite Group's VB How-To, 2nd Edition).  Here's how we can be reached:

James Shields

CompuServe: 71231,2066

US Mail: P.O. Box 31926; Seattle, WA 98103-1926

Zane Thomas:

CompuServe: 72060,3327

US Mail: P.O. Box 300; Indianola, WA  98342