   Help for PerCnt

Properties	Events

Registration Information

Order Form

Getting Custom Controls Written

Description

PerCnt is a Visual Basic custom control that makes status (percentage) bar display easy.

File Name

PERCNT2.VBX

Object Type

Percent

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


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	FontItalic	Name

*BevelBar	FontName	Parent

*BevelInner	FontSize	*Percent

*BevelOuter	FontStrikethru	Tag

*BevelWidthBar	FontUnderline	*TextBackColor

*BevelWidth	ForeColor	*TextForeColor

*Border	Height	*ThreeD

*BorderWidth	hWnd	Top

Enabled	Index	Visible

FontBold	Left	Width

Percent is the default value for the control.


BevelBar Property

See Also	Example

Description

Determines the 3-D style of the percentage bar.

Usage

[form.][control.]BevelBar[ = integer ]

Remarks

The value of this property determines the style of the percentage bar.  If the ThreeD property is set to False, this property is ignored.  This property may be one of four values:

Value	Description

0	Normal bar

1	Raised percentage bar (3-D)

2	Inset percentage bar (3-D)

3	Lowered percentage bar (3-D)

Data Type

Integer (enumerated)


See Also

Properties:

BevelInner

BevelOuter

BevelWidthBar

Percent

ThreeD


BevelBar Property Example
Bevel Example

In this example, the program will styles of the bevels used. To try this example, paste the code into the Declarations section of a form that contains a four horizontal scroll bars (one for BevelBar, one for BevelInner, and one for BevelOuter, and one to control the percentage bar), three labels (which show the properties), and a PerCnt control.  Press F5.  Play with  the scroll bars to see things change.

Sub Form_Load ()

    Me.BackColor = RGB(192, 192, 192)

    HScroll1.Value = 0

    HScroll1.Min = 0

    HScroll1.Max = 3

    HScroll2.Value = 0

    HScroll2.Min = 0

    HScroll2.Max = 3

    HScroll3.Value = 0

    HScroll3.Min = 0

    HScroll3.Max = 3

    HScroll4.Value = 50

    HScroll4.Min = 0

    HScroll4.Max = 100

    Percent1.BorderWidth = 3

    Percent1.BevelWidth = 2

    Percent1.BevelWidthBar = 2

    Percent1.ThreeD = True

    Percent1.BackColor = RGB(192, 192, 192)

    Call HScroll1_Change

    Call HScroll2_Change

    Call HScroll3_Change

    Call HScroll4_Change

End Sub

Sub HScroll1_Change ()

    Percent1.BevelBar = HScroll1.Value

    Label1.Caption = "BevelBar:" & Format$(HScroll1.Value)

End Sub

Sub HScroll1_Scroll ()

    Call HScroll1_Change

End Sub

Sub HScroll2_Change ()

    Percent1.BevelInner = HScroll2.Value

    Label2.Caption = "BevelInner:" & Format$( HScroll2.Value )

End Sub

Sub HScroll2_Scroll ()

    Call HScroll2_Change

End Sub

Sub HScroll3_Change ()

    Percent1.BevelOuter = HScroll3.Value

    Label3.Caption = "BevelOuter:" & Format$( HScroll3.Value )

End Sub

Sub HScroll3_Scroll ()

    Call HScroll3_Change

End Sub

Sub HScroll4_Change ()

    Percent1.Percent = HScroll4.Value

End Sub

Sub HScroll4_Scroll ()

    Call HScroll4_Change

End Sub


BevelInner Property

See Also	Example

Description

Determines the 3-D style of the border immediately surrounding the percentage area.

Usage

[form.][control.]BevelInner[ = integer ]

Remarks

The value of this property determines the style of the percentage bar's border.  If the ThreeD property is set to False, this property is ignored.  This property may be one of four values:

Value	Description

0	Normal frame

1	Raised frame (3-D)

2	Inset frame (3-D)

3	Lowered frame (3-D)

Data Type

Integer (enumerated)


See Also

Properties:

BevelBar

BevelOuter

BevelWidth

BorderWidth

ThreeD


BevelOuter Property

See Also	Example

Description

Determines the 3-D style of the border (if any) surrounding the control.

Usage

[form.][control.]BevelOuter[ = integer ]

Remarks

The value of this property determines the style of the control's border.  If the ThreeD property is set to False, this property is ignored.  This property may be one of four values:

Value	Description

0	Normal frame

1	Raised frame (3-D)

2	Inset frame (3-D)

3	Lowered frame (3-D)

Data Type

Integer (enumerated)


See Also

Properties:

BevelBar

BevelInner

BevelWidth

BorderWidth

ThreeD


BevelWidth Property

See Also	Example

Description

Determines the width of the inner and outer borders (bevels).

Usage

[form.][control.]BevelWidth[ = integer ]

Remarks

The value of this property determines the width of the inner border (if any, see BevelInner) and the outer border (if any, see Border and BevelOuter).  This is always measured in pixels.

Data Type

Integer


See Also

Properties:

BevelInner

BevelOuter

Border

BorderWidth


BevelWidth Property Example
Width Properties Example

In this example, the program will vary the width of bevels. To try this example, paste the code into the Declarations section of a form that contains four horizontal scroll bars, three labels, and a PerCnt control (make this control wide).  Press F5.  Play with  the scroll bar to see things change.

Sub Form_Load ()

    HScroll1.Value = 2

    HScroll1.Min = 0

    HScroll1.Max = 10

    HScroll2.Value = 2

    HScroll2.Min = 0

    HScroll2.Max = 10

    HScroll3.Value = 2

    HScroll3.Min = 0

    HScroll3.Max = 10

    HScroll4.Value = 50

    HScroll4.Min = 0

    HScroll4.Max = 100

    Percent1.BevelInner = 1

    Percent1.BevelOuter = 3

    Percent1.BevelBar = 3

    Percent1.Percent = 50

    Call HScroll1_Change

    Call HScroll2_Change

    Call HScroll3_Change

End Sub

Sub HScroll1_Change ()

    Percent1.BevelWidth = HScroll1.Value

    Label1.Caption = "BevelWidth:" & Format$( HScroll1.Value )

End Sub

Sub HScroll1_Scroll ()

    Call HScroll_Change

End Sub

Sub HScroll2_Change ()

    Percent1.BevelWidthBar = HScroll2.Value

    Label2.Caption = "BevelWidthBar:" & Format$( HScroll2.Value )

End Sub

Sub HScroll2_Scroll ()

    Call HScroll2_Change

End Sub

Sub HScroll3_Change ()

    Percent1.BevelWidthBar = HScroll3.Value

    Label3.Caption = "BorderWidth:" & Format$( HScroll3.Value )

End Sub

Sub HScroll3_Scroll ()

    Call HScroll3_Change

End Sub

Sub HScroll4_Change ()

    Percent1.Percent = HScroll4.Value

End Sub

Sub HScroll4_Scroll ()

    Call HScroll4_Change

End Sub


BevelWidthBar Property

See Also	Example

Description

Determines the width of the 3-D effect (if any) of the percentage bar.

Usage

[form.][control.]BevelWidthBar[ = integer ]

Remarks

The value of this property determines the width of the 3-D effect (if any, see BevelBar). This is always measured in pixels.

Data Type

Integer


See Also

Properties:

BevelBar

ThreeD


Border Property

See Also	Example

Description

Determines whether or not there is a border around the control.

Usage

[form.][control.]Border[ = integer ]

Remarks

The value of this property determines whether or not the control has a border.  This property may be one of two values:

Value	Description

0	No border

1	Single width border

Data Type

Integer (enumerated)


See Also

Properties:

BevelOuter

ThreeD


Border Property Example
Border and ThreeD Properties 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 two check boxes, two labels, and a PerCnt control (make this control wide).  Press F5.  Play with the check boxes to see things change.

Sub Form_Load ()

    Check1.Value = 0

    Check2.Value = 0

    Percent1.BevelInner = 3

    Percent1.BevelOuter = 3

    Percent1.BevelBar = 3

    Percent1.BevelWidth = 2

    Percent1.BevelWidthBar = 2

    Percent1.BorderWidth = 3

    Call Check1_Change

    Call Check2_Change

End Sub

Sub Check1_Change ()

    Percent1.Border = Check1.Value

    If Check1.Value <> 0 Then

        Label1.Caption = "Border"

    Else

        Label1.Caption = "No Border"

    End If

End Sub

Sub Check2_Change ()

    Percent1.ThreeD = Check2.Value

    If Check2.Value <> 0 Then

        Label2.Caption = "ThreeD"

    Else

        Label2.Caption = "No NoThreeD"

    End If

End Sub


BorderWidth Property

See Also	Example

Description

Determines the distance between the inner border and the outer border.

Usage

[form.][control.]BorderWidth[ = integer ]

Remarks

The value of this property determines the distance between the outer border (if any, see Border and BevelOuter) and the inner border (if any, see BevelInner).  This is always measured in pixels.

Data Type

Integer


See Also

Properties:

BevelInner

BevelOuter

ThreeD


Percent Property

See Also	Example

Description

Sets the value of the status (percentage) bar.

Usage

[form.][control.]Percent[ = integer ]

Remarks

This property determines how much of the status (percent) bar is full and what value is displayed in the center of the box.  This property can range from 0 to 100.

This property is the default value of the control.

Data Type

Integer


See Also

Properties:

BevelBar

BevelWidthBar


Percent Property Example

In this example, the program will show the percentage bar going up and down. To try this example, paste the code into the Declarations section of a form that contains two command buttons and a PerCnt control.  Press F5.  Play with the buttons.

Sub Form_Load ()

    Command1.Caption = "Up"

    Command2.Caption = "Down"

End Sub

Sub Command1_Click ()

    Dim I As Integer

    For I = 0 To 100

        Percent1.Percent = I

    Next I

End Sub

Sub Command2_Click ()

    Dim I As Integer

    For I = 100 To 0 Step -1

        Percent1.Percent = I

    Next I

End Sub


TextBackColor Property

See Also

Description

Sets the color of the text when it's in the background.

Usage

[form.][control.]TextBackColor[ = color ]

Remarks

This property determines what color the text is when it's on the right side of the percentage bar.

Data Type

Color


See Also

Properties:

Percent

TextForeColor


TextForeColor Property

See Also

Description

Sets the color of the text when it's in the foreground.

Usage

[form.][control.]TextForeColor[ = color ]

Remarks

This property determines what color the text is when it's on the left side of the percentage bar (i.e., contained within it).

Data Type

Color


See Also

Properties:

Percent

TextBackColor


ThreeD Property

See Also	Example

Description

Determines whether or not 3-D effects are used.

Usage

[form.][control.]ThreeD[ = boolean ]

Remarks

If this property is set to False, all of the Bevel and Border description properties are ignored.  In this case, PerCnt either draws a plain, thin border, or nothing at all (this depends on the Border property).

If this property is set to True (the default), all of the properties affect the appearance of PerCnt.

Data Type

Integer (boolean)


See Also

Properties:

BevelBar

BevelInner

BevelOuter

BevelWidth

BevelWidthBar

Border

BorderWidth


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

PerCnt 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:

Mabry Software

Post Office Box 31926

Seattle, WA  98103-1926

Registration

You can register this program by sending $10 ($12 for international orders) and your address.  CompuServe members may register by sending $5 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.  PerCnt is registered there.  PerCnts registration ID number is 966.

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

Source Code and Registration

Source code (which includes a registered copy) to this control is available for $25 ($30 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 $20.  It's registration number is 1004.

Credit Card Orders

You can order this program with Mastercard, Visa, American Express, or Discover from Public (software) Library by calling 800-242-4775 or 713-524-6394 or by FAX to 713-524-6398 or by CompuServe E-mail to 71355,470.  You can also mail credit card orders to PsL at Post Office Box 35705; Houston, TX 77235-5705.  THESE NUMBERS ARE FOR CREDIT CARDS ONLY.

PerCnt's ID number for this service is 11100.  This is good for both the normal registered version, and the source code version.

Any questions about the status of the shipment of the order, refunds, registration options, product details, technical support, volume discounts, dealer pricing, site licenses, etc., must be directed to Mabry Software at 206-634-1443 or FAX at 206-632-0272.

To ensure that you get the latest version, PsL will notify us the day of your order and we will ship the product directly to you.

© Copyright 1993-1994 by James Shields


Order Form
 PerCnt 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 PerCnt?

____________________________________________________________________

Ship to:	____________________________________________________________________

____________________________________________________________________

____________________________________________________________________

____________________________________________________________________

____________________________________________________________________

Phone:	_________________________________________________________________

Fax:	_________________________________________________________________

E-Mail:	_________________________________________________________________

Disk Size:	(circle one)	 3½	5¼

qty ordered	____	REGISTRATION

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

qty ordered	____	SOURCE CODE AND REGISTRATION

$25 each, postpaid (check or money order in hard currency).  Foreign 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