   Help for BarCod

Properties	Events

Registration Information

Order Form

Getting Custom Controls Written

Description

BarCod makes bar code display really easy.  Just pick the orientation, set the size, and pick the bar code style.  Then, set the caption to whatever you want the bars to be.

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 VB 3.0, BarCod will bind to a data control.  It uses the DataField, DataSource, and DataChanged properties.

File Name

BARCOD1.VBX

Object Type

BarCode

Compatibility

VB1 and up

Distribution Note     When you develop and distribute an application that uses BarCod, you should install the file BARCOD1.VBX into the users Windows SYSTEM directory.  BarCod has version information built into it.  So, during installation, you should ensure that you are not overwriting a newer version of BarCod.


Properties

All of the properties that apply to this control are in this table.  Properties that have special meaning for this control or that only apply to this control are marked with an asterisk (*).

BackColor	HelpContextID	*PrinterScaleMode

*BarWidth	Height	*PrinterTop

Caption	hWnd	*PrinterWidth

DataChanged	Index	*Style

DataField	Left	Tag

DataSource	Name	Top

*Direction	Parent	Visible

*Displayed	*PrinterHDC	UPCNotches

Enabled	*PrinterHeight	Width

ForeColor	*PrinterLeft

Caption is the default value for the control.


BarWidth Property

See Also	Example

Description

Determines the width of the bars in the bar code.

Usage

[form.][control.]BarWidth[ = integer ]

Remarks

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

Data Type

Integer


See Also

Properties:

Direction

Style


BarWidth Property Example

In this example, the program will vary the width of the bars. To try this example, paste the code into the Declarations section of a form that contains a horizontal scroll bar, a label (which shows the current BarWidth property), and a BarCod control (make this control wide).  Press F5.  Play with  the scroll bar to see things change.

Sub Form_Load ()

    HScroll1.Value = 0

    HScroll1.Min = 0

    HScroll1.Max = 10

    Label1.Caption = "0"

    BarCod1.Style = 3

    BarCod1.BarWidth = 0

    BarCod1.Caption = "SAMPLE"

End Sub

Sub HScroll1_Change ()

    BarCod1.BarWidth = HScroll1.Value

    Label1.Caption = Format$( HScroll1.Value )

End Sub

Sub HScroll1_Scroll ()

    Call HScroll_Change

End Sub


Direction Property

See Also	Example

Description

Determines the direction/orientation of the bar code.

Usage

[form.][control.]Direction[ = integer ]

Remarks

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

Value	Description

0	Left-to-right

1	Right-to-left

2	Top-to-bottom

3	Bottom-to-top

Data Type

Integer (enumerated)


See Also

Properties:

BarWidth

Style


Direction Property Example

In this example, the program will vary the direction the bar code is painted/printed. To try this example, paste the code into the Declarations section of a form that contains a horizontal scroll bar, a label (which shows the current Direction property), and a BarCod control (make this control tall and wide).  Press F5.  Play with  the scroll bar to see things change.

Sub Form_Load ()

    HScroll1.Value = 0

    HScroll1.Min = 0

    HScroll1.Max = 3

    Label1.Caption = "0"

    BarCod1.Style = 3

    BarCod1.BarWidth = 2

    BarCod1.Direction = 0

    BarCod1.Caption = "SAMPLE"

End Sub

Sub HScroll1_Change ()

    BarCod1.Direction = HScroll1.Value

    Label1.Caption = Format$( HScroll1.Value )

End Sub

Sub HScroll1_Scroll ()

    Call HScroll_Change

End Sub


Displayed Property

See Also	Example

Description

Returns the actual string displayed in the bar code.

Usage

[form.][control.]Displayed

Remarks

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

This property is read-only.

Data Type

String


See Also

Properties:

Caption

Style


Displayed Property Example

In this example, the program will show what is displayed when various strings are attempted. To try this example, paste the code into the Declarations section of a form that contains a label (which shows the current Displayedn property), a text box, and a BarCod control.  Press F5.  Play with the edit box and see what appears in the label.

Sub Form_Load ()

    Label1.Caption = "0"

    Text1.Text = "SAMPLE"

    BarCod1.Style = 3

    BarCod1.BarWidth = 2

    BarCod1.Direction = 0

    BarCod1.Caption = Text1.Text

End Sub

Sub Text1_Change ()

    BarCod1.Caption = Text1.Text

    Label1.Caption = BarCod1.Displayed

End Sub


PrinterHDC Property

See Also	Example

Description

Causes the bar code to be painted in the device handle specified (usually the printer object).

Usage

[form.][control.]PrinterHDC[ = integer ]

Remarks

When this property is set, BarCod paints itself into the Windows device context specified.  Normally, this is used to print the barcode.  To do this, use the hDC property of VBs Printer Object.

To print a bar code, make sure the Caption property is set correctly.  Then, set the PrinterHeight , PrinterLeft , PrinterTop , and PrinterWidth properties.  Finally, set BarCod.PrinterHDC to Printer.hDC.

Data Type

Integer


See Also

Objects:

Printer Object

Properties:

hDC

PrinterLeft, PrinterTop, PrinterRight, PrinterBottom

PrinterScaleMode

Style


PrinterLeft, PrinterTop, PrinterWidth, and PrinterHeight Properties

See Also	Example

Description

Describes the area in which to paint the barcode when printing.

Usage

[form.][control.]PrinterLeft[ = x ]

[form.][control.]PrinterTop[ = y ]

[form.][control.]PrinterWidth[ = xx ]

[form.][control.]PrinterHeight[ = ny ]

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 bar code, make sure the Caption property is set correctly.  Then, set the PrinterHeight , PrinterLeft , PrinterTop , and PrinterWidth properties.  Finally, set BarCod.PrinterHDC to Printer.hDC.

Data Type

Integer (long)


See Also

Properties:

Caption

PrinterHDC

PrinterScaleMode

Style


PrinterScaleMode Property

See Also	Example

Description

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

Usage

[form.][control.]PrinterScaleMode[ = integer ]

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 bar code, make sure the Caption property is set correctly.  Then, set the PrinterHeight, PrinterLeft, PrinterTop, and PrinterWidth properties.  Finally, set BarCod.PrinterHDC to Printer.hDC.

Data Type

Integer (enumerated)


See Also

Properties:

Caption

PrinterHDC

PrinterLeft, PrinterTop, PrinterWidth, PrinterHeight

Style


Printing Example

In this example, the program will print a bar code on your printer.  The bar code and its style are determined by an edit box and a horizontal scroll bar. To try this example, paste the code into the Declarations section of a form that contains a text box, a command button, two labels, a horizontal scroll bar, and a BarCod control.  Press F5.  Then, set up the bar code using the horizontal scroll bar and the text box.  Once you have a bar code you like, press the command button to print it.

Sub Form_Load ()

    HScroll1.Min = 0

    HScroll1.Max = 3

    HScroll1.Value = 3

    Text1.Text = "SAMPLE"

    BarCod1.Style = 3

    BarCod1.BarWidth = 0

    BarCod1.Direction = 0

    BarCod1.Caption = Text1.Text

    Label1.Caption = BarCod1.Displayed

    Label2.Caption = "3"

End Sub

Sub Command1_Click ()

    Screen.MousePointer = 11

    Printer.ScaleMode = 1

    BarCod1.PrinterScaleMode = Printer.ScaleMode

    BarCod1.PrinterLeft = 1440

    BarCod1.PrinterTop = 1440

    BarCod1.PrinterWidth = 3 * 1440

    BarCod1.PrinterHeight = 720

    BarCod1.PrinterHDC = Printer.hDC

    Printer.CurrentX = BarCod1.PrinterLeft

    Printer.CurrentY = BarCod1.PrinterTop + BarCod1.PrinterHeight + 180

    Printer.Print BarCod1.Displayed

    Printer.NewPage

    Printer.EndDoc

    Screen.MousePointer = 0

End Sub

Sub Text1_Change ()

    BarCod1.Caption = Text1.Text

    Label1.Caption = BarCod1.Displayed

End Sub

Sub HScroll1_Change ()

    BarCod1.Style = HScroll1.Value

    Label1.Caption = BarCod1.Displayed

    Label2.Caption = Format$( HScroll1.Value )

End Sub

Sub HScroll1_Scroll ()

    Call HScroll1_Change

End Sub


Style Property

See Also	Example

Description

Determines what bar code style is used.

Usage

[form.][control.]Style[ = integer ]

Remarks

This property determines the style of bar code used.  Each style has a different set of characters 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, and - . * $ / + % (default)

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

5	Extended 3 of 9 - full ASCII character set

6	Code 128A - upper case, numbers, punctuation, and control characters

7	Code 128B - upper and lower case, numbers, and punctuation

8	Code 128C - numbers only

9	UPC-A - numbers only (11 numbers and a check digit)

10	MSI (Plessey) - numbers only

11	Code 93 - numbers, upper case, and - . * $ / + %

12	Extended Code 93 - full ASCII character set

13	EAN-13 - numbers only (12 numbers and a check digit)

14	EAN-8 - numbers only (7 numbers and a check digit)

Data Type

Integer (enumerated)


See Also

Properties:

BarWidth

Direction

UPCNotches


Code 2 of 5


Interleaved 2 of 5


Extended Code 3 of 9


Code 3 of 9


Extended Code 93


EAN-13


EAN-8


Code 93


Code 128A


Code 128B


Code 128C


UPC-A


MSI (Plessey)


Rationalized Codabar


Style Property Example

In this example, the program will vary style of the bar code used. To try this example, paste the code into the Declarations section of a form that contains a horizontal scroll bar, two labels (the first shows the Style property and the second shows the current Displayedn property), a text box, and a BarCod control.  Press F5.  Play with the text box and the scroll bar and see what appears in the second label.

Sub Form_Load ()

    HScroll1.Min = 0

    HScroll1.Max = 10

    HScroll1.Value = 3

    Text1.Text = "SAMPLE"

    BarCod1.Style = 3

    BarCod1.BarWidth = 2

    BarCod1.Direction = 0

    BarCod1.Caption = Text1.Text

    Label1.Caption = BarCod1.Displayed

    Label2.Caption = "3"

End Sub

Sub Text1_Change ()

    BarCod1.Caption = Text1.Text

    Label1.Caption = BarCod1.Displayed

End Sub

Sub HScroll1_Change ()

    BarCod1.Style = HScroll1.Value

    Label1.Caption = BarCod1.Displayed

    Label2.Caption = Format$( HScroll1.Value )

End Sub

Sub HScroll1_Scroll ()

    Call HScroll1_Change

End Sub


UPCNotches Property

See Also

Description

Determines where the notches are on a UPC barcode.

Usage

[form.][control.]UPCNotches[ = integer ]

Remarks

This property determines the where the notches are (if any) on a UPC barcode.  The settings are:

Value	Description

0	None

1	Above

2	Below

3	Both (default)

Data Type

Integer (enumerated)


See Also

Properties:

Style


Events

All of the events that apply to this control are in this table.  Events that have special meaning for this control or that only apply to this control are marked with an asterisk (*).

Click

DblClick


Registration Information

Credits

BarCod was written by James Shields.  Inquiries can be sent to 71231,2066 on CompuServe, or mabry@halcyon.com on Internet.  Our mailing address is:

Mabry Software, Inc.

Post Office Box 31926

Seattle, WA  98103-1926

Registration

You can register this program by sending $15 ($20 for international orders) and your address.  You can register BarCod and its C source code by sending $45 ($50 for international orders).  With your order, you will receive a copy of our manual documenting all of our controls.

For your convenience, an order form has been provided that you can print out directly from this help file.

E-mail Discount

You may take a $5 discount for e-mail delivery of this package (CompuServe or Internet).  If you choose this option, please note: a printed manual is not included.  Be sure to include your full mailing address with your order.  Sometimes (on the Internet) the package cannot be e-mailed.  So, we are forced to send it through the normal mails.

CompuServe members may also take the $5 e-mail discount by registering this package in the software registration forum (GO SWREG).  BarCods SWREG ID number is 1314.  The source code version's ID number is 1315.

Credit Card Orders

We accept VISA and Mastercard.  If you e-mail your order to us, please be sure to include your card number, expiration date, complete mailing address, and your phone number (in case we have any questions about your order).

© Copyright 1993-1995 by Mabry Software, Inc.


Order Form
 BarCod Order Form

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

Mail this	Mabry Software, Inc.

form to:	Post Office Box 31926

Seattle, WA  98103-1926

Phone: 206-634-1443

Fax: 206-632-0272

BBS: WinDev BBS 206-634-0783

CompuServe: 71231,2066

Internet: mabry@halcyon.com

Where did you get this copy of BarCod?

____________________________________________________________________

Ship to:	____________________________________________________________________

____________________________________________________________________

____________________________________________________________________

____________________________________________________________________

____________________________________________________________________

Phone:	_________________________________________________________________

Fax:	_________________________________________________________________

E-Mail:	_________________________________________________________________

MC/VISA:	_________________________________________ exp. ___________________

Disk Size:	(circle one)	 3½	5¼

qty ordered	____	REGISTRATION

$15 each, postpaid (check or money order in hard currency). Outside of North America add $5.00 shipping.

qty ordered	____	SOURCE CODE AND REGISTRATION

$45 each, postpaid (check or money order in hard currency). Outside of North America add $5.00 shipping.


Getting Custom Controls Written

If you or your organization would like to have custom controls written, you can contact me at the following:

James Shields

Mabry Software, Inc.

Post Office Box 31926

Seattle, WA  98103-1926

Phone: 206-634-1443

Fax: 206-632-0272

BBS: WinDev BBS 206-634-0783

CompuServe: 71231,2066

Internet: mabry@halcyon.com

You can also contact Zane Thomas.  He can be reached at:

Zane Thomas

Post Office Box 300

Indianola, WA  98342

CompuServe: 72060,3327