 Help for FLabel

Properties	Events

Registration Information

Order Form

Getting Custom Controls Written

Description

FLabel is a label control that lets you format the text within it.  You can have different fonts, different colors, multiple paragraphs, paragraph formatting, etc.  All this and it's bound, too.

File Name

FLABEL1.VBX

Object Type

FLabel

Compatibility

VB 2.0 and above

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


Properties
FLabel Properties

Properties that have special meaning for this control or that only apply to this control are marked with an asterisk (*).

AutoSize Property

BackColor Property

BackStyle Property

*Caption Property (default)

DataChanged Property

DataField Property

DataSource Property

*Delimiter Property

DragIcon Property

DragMode Property

Enabled Property

FontBold Property

FontItalic Property

FontName Property

FontSize Property

FontStrike Property

FontUnder Property

ForeColor Property

Height Property

Index Property

Left Property

LinkItem Property

LinkMode Property

LinkTimeout Property

LinkTopic Property

MousePointer Property

Name Property

*ParaBefore Property

*ParaFirst Property

*ParaLeft Property

*ParaRight Property

Parent Property

*PrinterHDC Property

*PrinterHeight Property

*PrinterLeft Property

*PrinterScaleMode Property

*PrinterTop Property

*PrinterWidth Property

TabIndex Property

Tag Property

Top Property

Visible Property

Width Property

WordWrap Property


Events
FLabel Events

Click Event

DblClick Event

DragDrop Event

DragOver Event

LinkChange Event

LinkClose Event

LinkError Event

LinkOpen Event

MouseDown Event

MouseMove Event

MouseUp Event


AutoSize Property


BackStyle Property


WordWrap Property


Caption Property

See Also	Example

Description

Determines the text that is displayed.

Usage

[form.][control.]Caption[ = string ]

Remarks

This property determines what the control displays.  This can be comprised of both text and formatting commands.

Formatting codes are specified by enclosing them within delimiter characters (see the Delimiter property).  For example, to show the sentence "This is cool." with the word "cool" printed in blue, you would set the Caption property to:

This is |Color:Blue|cool|Color:Black|.

If you wanted to display "Mabry Software" on one line followed by "800-99-MABRY (toll free)" on the next, you would set the Caption property to:

Mabry Software|cr|800-99-MABRY (toll free)

You can print the delimiter character by putting it twice in the string.  For example, the delimiter character was a dollar sign ($), and your Caption string is:

The price is $$35.00.

The output would be:

The price is $35.00

Here are all of the formatting codes for FLabel VBX:

Code	Meaning

B:<boolean>	Bold face (on or off, depending on the value of boolean)

BACK:<color>	Set the current background color.

BEFORE:<twips>	Set the vertical gap that preceeds a paragraph (in twips).

BOLD:<boolean>	Bold face (on or off, depending on the value of boolean)

COLOR:<color>	Set the current foreground (text) color.

CR	Start new paragraph

FIRST:<twips>	Set first indent for a paragraph (in twips)

FONT:<name>	Change to new font, specified by <name>

FORE:<color>	Set the current foreground (text) color.

I:<boolean>	Italics (on or off, depending on the value of boolean)

ITAL:<boolean>	Italics (on or off, depending on the value of boolean)

LEFT:<twips>	Set left margin for a paragraph (in twips)

RIGHT:<twips>	Set the right margin for a paragraph (in twips).

S:<boolean>	Strikethru (on or off, depending on the value of boolean)

SIZE:<points>	Change font size, specified in points.

STRIKE:<boolean>	Strikethru (on or off, depending on the value of boolean)

U:<boolean>	Underline (on or off, depending on the value of boolean)

UNDER:<boolean>	Underline (on or off, depending on the value of boolean)

Twips values are just that: twips.  These are the units typically used in VB.

Boolean values are pretty flexible.  On, True, 1, and Yes all count as True.  Off, False, 0, and No all word as False.

Color values can take one of two formats: direct RGB numbers, or a color name.  RGB numbers should be formatted like: 128,128,128 (i.e., in decimal, separated by commas).  Here are the color names and their associated RGB values that FLabel supports:

Code	Red	Green	Blue

Aqua	128	255	255

Black	0	0	0

Blue	0	0	255

Brown	128	64	0

Cyan	0	255	255

DkBlue	0	0	128

DkCyan	0	128	128

DkGray	128	128	128

DkGreen	0	128	0

DkRed	128	0	0

Gray	128	128	128

Green	0	255	0

LtBlue	128	128	255

LtGray	192	192	192

LtGreen	128	255	128

LtPurple	255	128	255

LtRed	255	128	128

Magenta	255	0	255

Purple	128	0	128

Red	255	0	0

Tan	128	128	0

White	255	255	255

Yellow	255	255	0

Any of these properties will take the special keyword "Default" or "D".  This will set that element back to its default value.  For example, if you had "Fore:D" at one point in the string, this would reset the text color to the color found in ForeColor.

Data Type

String


See Also

Properties:

Delimiter

ParaBefore

ParaFirst

ParaLeft

ParaRight


Delimiter Property

See Also

Description

Determines the separator/specifier character for the formatting strings in the Caption property.

Usage

[form.][control.]Delimiter[ = string ]

Remarks

This property determines the character that is used for the formatting string/code delimiter.  This property defaults to a vertical bar/pipe character: |

Data Type

String


See Also

Properties:

Caption


ParaBefore, ParaFirst, ParaLeft and ParaRight Properties

See Also

Description

Determines the margins/gaps for the paragraph.

Usage

[form.][control.]ParaBefore[ = twips ]

[form.][control.]ParaFirst[ = twips ]

[form.][control.]ParaLeft[ = twips ]

[form.][control.]ParaRight[ = twips ]

Remarks

These properties determine the margins and gaps for paragraph formatting.  ParaBefore is the amount of vertical space that should be before each paragraph (except the first).  ParaFirst is the amount of horizontal space between the left edge of the control and the first line of a paragraph.  ParaLeft is the amount of space between the left edge of the control and any lines in a paragraph after the first.  And, ParaRight is the amount of space between the right edge of the control and the right edge of a paragraph.

These are the default settings for the control.  They can be overriden using various keywords in the Caption property.

Data Type

Integer (long)


See Also

Properties:

Caption


Caption Example

In this example, the program allows you to play with formatting.  When you change the text in the edit box, it shows it in the FLabel.  To try this example, paste the code into the Declarations section of a form that contains an edit box and an FLabel control.  Press F5 and play with the edit box.

Option Explicit

Sub Form_Load ()

    FLabel1.ParaBefore = 240

    FLabel1.ParaFirst = 480

    FLabel1.WordWrap = True

    Text1.Text = "This is a test of |color:blue|FLabel VBX|color:black|.  Play with this text to change the formatting.|cr|It's fun ..."

End Sub

Sub Text1_Change ()

    FLabel1.Caption = Text1.Text

End Sub


PrinterHDC Property

See Also

Description

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

Usage

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

Remarks

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

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

Data Type

Integer


See Also

Objects:

Printer Object

Properties:

hDC

PrinterLeft, PrinterTop, PrinterRight, PrinterBottom

PrinterScaleMode


PrinterLeft, PrinterTop, PrinterWidth, and PrinterHeight Properties

See Also

Description

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

Usage

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

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

[form.][control.]PrinterWidth[ = nx ]

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

Remarks

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

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

Data Type

Integer (long)


See Also

Properties:

Caption

PrinterHDC

PrinterScaleMode


PrinterScaleMode Property

See Also

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

Data Type

Integer (enumerated)


See Also

Properties:

Caption

PrinterHDC

PrinterLeft, PrinterTop, PrinterWidth, PrinterHeight


Registration Information

Credits

FLabel 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

Post Office Box 31926

Seattle, WA  98103-1926

Registration

You can register this program by sending $20 ($25 for international orders) and your address.  You can register FLabel and its C source code by sending $50 ($55 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).  Labels SWREG ID number is 4352.  The source code version's ID number is 4353.

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 1994-1995 by James Shields


Order Form
 FLabel Order Form

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

Mail this	Mabry Software

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 FLabel?

____________________________________________________________________

Ship to:	____________________________________________________________________

____________________________________________________________________

____________________________________________________________________

____________________________________________________________________

____________________________________________________________________

Phone:	_________________________________________________________________

Fax:	_________________________________________________________________

E-Mail:	_________________________________________________________________

Disk Size:	(circle one)	 3½	5¼

qty ordered	____	REGISTRATION

$20 each, postpaid (check or money order in hard currency).  International addresses add $5.00 shipping.  No additional shipping charges to Canada or Mexico.

qty ordered	____	SOURCE CODE AND REGISTRATION

$50 each, postpaid (check or money order in hard currency).  International addresses add $5.00 shipping.  No additional shipping charges to Canada or Mexico.


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

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