Copyright: Copyright © 1995 Caprock Software
Citation: Copyright © 1995 Caprock Software


 Meter Bar Control

Properties	Methods	Events

Description

Meter bars are display-only horizontal or vertical controls that simulate progress or analog information.  They allow you to "fill up" the control at any rate.  Meter bar controls are typically used in installation programs that show percentage of files copied.  The horizontal LED meter bar is used during short-duration processes while the solid meter bar is used for long-duration processes.  Vertical meter bars are typically used for displaying analog data.

File Name

MBAR.VBX

Remarks

The Meter Bar has a few custom properties that allow you to change the appearance of the control.  The rate at which you fill the control can be set at any number between 1 and 32767.  You do not have to worry about displaying the "percentage complete", the control will figure this out for you.

This Meter Bar control was designed for and tested with Microsoft Visual C++ v1.51, Borland C++ v4.5 and Microsoft Visual Basic v3.0 and Windows v3.1.  It was written in Visual C++ v1.51.

Bound Properties

This control is not a bound control.

Distribution Note	When you create and distribute applications that use the Meter Bar control, you should install the file MBAR.VBX  in the customer's Microsoft Windows\SYSTEM sub directory.  The Setup Wizard included with Visual Basic provides tools to help you write setup programs that install your application correctly.

Copyright


Copyright

This Meter Bar control is shareware.  You can evaluate this control free of charge for 30 days.

If you like it, please pay $12.00.  You can also purchase the source code for $70.00 (this includes your registration fee).

You can register the VBX on Compuserve in the SWREG forum using SWREG ID: 5168.  You can also purchase the source code using SWREG ID: 5169.  Or, send check or money order to:  Caprock Software, 4032 N. Story Rd. #124A, Irving, Texas 75038.

Visual Basic v3.0, Windows v3.1 and Visual C++ v1.51 are copyrights of Microsoft Corp.  Borland C++ v4.5 is a copyright of Borland Intl.

Please feel free to send suggestions and comments to Caprock Software at CompuServe: 73474,313 or Internet: sstubbs@iadfw.net.


Properties

All of the properties for this control are listed in the following table.  Properties that apply only to this control, or that require special consideration when used with it, are marked with an asterisk (*).  For documentation of the remaining properties, see the Visual Basic manuals.

BackColor	hWnd	Parent
BorderStyle	Height	Name
FontBold	HelpContextID	*Orientation
FontItalic	Index	*Position
FontName	*LEDSpace	*Range
FontSize	*LEDThick	Tag
FontStrike	Left	Top
FontUnder	*Margin	Visible
ForeColor	MousePointer	Width

Position is the default value


Methods

All the methods for this control are listed in the following table.  For documentation of the following methods, see the Visual Basic manuals.

Move	ZOrder
Refresh


Events

All of the events for this control are listed in the following table.  Events that apply only to this control, or that require special consideration when used with it, are marked with an asterisk (*).  For documentation of the remaining events, see the Visual Basic manuals.

Click	DragOver	MouseUp
DblClick	MouseDown
DragDrop	MouseMove
Click is the default event


BorderStyle Property, Meter Bar Control

Description

Determines the border style for a meter bar.

Syntax

Visual Basic	[form.]MeterBar.BorderStyle[ = setting%]

Visual C++	pMeterBar->GetNumProperty("BorderStyle")

pMeterBar->SetNumProperty("BorderStyle", setting)

Borland C++	pMeterBar->GetProp("BorderStyle", &setting)

pMeterBar->SetProp("BorderStyle", setting)

Remarks

The following table lists the BorderStyle settings for the Meter Bar.

Setting	Description

0	None (no border or related border elements).

1	Fixed Single.  A single black line borders the meter bar control.

2	(Default) Three D.  A three dimensional border surrounds the meter bar control.

Data Type

Integer (Enumerated)


LEDSpace Property, Meter Bar Control

Description

The value of LEDSpace is the spacing between the LED bars on the meter bar.

Syntax

Visual Basic	[form.]MeterBar.LEDSpace[ = setting%]

Visual C++	pMeterBar->GetNumProperty("LEDSpace")

pMeterBar->SetNumProperty("LEDSpace", setting)

Borland C++	pMeterBar->GetProp("LEDSpace", &setting)

pMeterBar->SetProp("LEDSpace", setting)

Remarks

Please note that the percentage is not displayed while using LEDSpace.  The standard spacing is 2

Data Type

Integer


LEDThick Property, Meter Bar Control

Description

LEDThick is the thickness of the LED bars on the meter bar.

Syntax

Visual Basic	[form.]MeterBar.LEDThick[ = setting%]

Visual C++	pMeterBar->GetNumProperty("LEDThick")

pMeterBar->SetNumProperty("LEDThick", setting)

Borland C++	pMeterBar->GetProp("LEDThick", &setting)

pMeterBar->SetProp("LEDThick", setting)

Remarks

The standard thickness is 90.

Data Type

Integer


Margin Property, Meter Bar Control

Description

The border width and height between the 3D frame and the LED bar or solid bar.

Syntax

Visual Basic	[form.]MeterBar.Margin[ = setting%]

Visual C++	pMeterBar->GetNumProperty("Margin")

pMeterBar->SetNumProperty("Margin", setting)

Borland C++	pMeterBar->GetProp("Margin", &setting)

pMeterBar->SetProp("Margin", setting)

Remarks

The standard margin is 2.

Data Type

Integer


Orientation Property, Meter Bar Control

Description

Sets the orientation or direction for "filling up" the control.

Syntax

Visual Basic	[form.]MeterBar.Orientation[ = setting%]

Visual C++	pMeterBar->GetNumProperty("Orientation")

pMeterBar->SetNumProperty("Orientation", setting)

Borland C++	pMeterBar->GetProp("Orientation", &setting)

pMeterBar->SetProp("Orientation", setting)

Remarks

The following table lists the Orientation property settings for the Meter Bar.

Setting	Description

0	(Default) Fill control horizontally from left to right.

1	Fill control vertically from bottom to top

Setting 0 is most familiar during processing of information.  Setting 1 is most common for displaying analog information.

Data Type

Integer (Enumerated)


Position Property, Meter Bar Control

Description

Sets the amount to fill the control.

Syntax

Visual Basic	[form.]MeterBar.Position[ = value%]

Visual C++	pMeterBar->GetNumProperty("Position")

pMeterBar->SetNumProperty("Position", setting)

Borland C++	pMeterBar->GetProp("Position", &setting)

pMeterBar->SetProp("Position", setting)

Remarks

The value of Position must be between 0 and the Range property.  Position can not exceed the Range value.  The "percentage complete" is automatically calculated for you.

Data Type

Integer


Range Property, Meter Bar Control

Description

Sets the maximum value the Position property can be to "fill up" the control.

Syntax

Visual Basic	[form.]MeterBar.Range[ = value%]

Visual C++	pMeterBar->GetNumProperty("Range")

pMeterBar->SetNumProperty("Range", setting)

Borland C++	pMeterBar->GetProp("Range", &setting)

pMeterBar->SetProp("Range", setting)

Remarks

The value of Range can not be less than 1 and can not exceed the integer maximum 32767.  Since you can specify a range greater than 100, the control calculates the "percentage complete" automatically for you.

Data Type

Integer