property Layers.Count as Long
Specifies the number of layers.

TypeDescription
Long A Long expression that specifies the count of layers within the control.
The Count property specifies the number of layers in the control. The PicturesPath Specifies the path to load the pictures from. The PicturesName property specifies the expression that indicates the name of the picture to be loaded on each layer. The Item property of the Layers collection accesses a Layer giving its index or key. The Index property is read-only and zero-based, which indicates that the layer with the Index property 0, it is the first layer, while the layer with the index Count - 1, is the last layer in the control ( in z-order ). The Background object holds pictures to be shown on the layer's background. The Foreground property of the Layer access the layer's Foreground object. The for each statement can be used to enumerate Layer objects in the Layers collection.

The following properties can be used to add / remove layers within the control:

The following properties can be used to access Layer objects in the control:

The following samples use the Layers.Count property to add new layers: 

VBA (MS Access, Excell...)

With Gauge1
	.BeginUpdate 
	.PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Knob 2"
	.PicturesName = "`Layer` + str(value + 1) + `.png`"
	.Layers.Count = 5
	.EndUpdate 
End With

VB6

With Gauge1
	.BeginUpdate 
	.PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Knob 2"
	.PicturesName = "`Layer` + str(value + 1) + `.png`"
	.Layers.Count = 5
	.EndUpdate 
End With

VB.NET

With Exgauge1
	.BeginUpdate()
	.PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Knob 2"
	.PicturesName = "`Layer` + str(value + 1) + `.png`"
	.Layers.Count = 5
	.EndUpdate()
End With

VB.NET for /COM

With AxGauge1
	.BeginUpdate()
	.PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Knob 2"
	.PicturesName = "`Layer` + str(value + 1) + `.png`"
	.Layers.Count = 5
	.EndUpdate()
End With

C++

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXGAUGELib' for the library: 'ExGauge 1.0 Control Library'

	#import <ExGauge.dll>
	using namespace EXGAUGELib;
*/
EXGAUGELib::IGaugePtr spGauge1 = GetDlgItem(IDC_GAUGE1)->GetControlUnknown();
spGauge1->BeginUpdate();
spGauge1->PutPicturesPath(L"C:\\Program Files\\Exontrol\\ExGauge\\Sample\\Design\\Circular\\Knob 2");
spGauge1->PutPicturesName(L"`Layer` + str(value + 1) + `.png`");
spGauge1->GetLayers()->PutCount(5);
spGauge1->EndUpdate();

C++ Builder

Gauge1->BeginUpdate();
Gauge1->PicturesPath = L"C:\\Program Files\\Exontrol\\ExGauge\\Sample\\Design\\Circular\\Knob 2";
Gauge1->PicturesName = L"`Layer` + str(value + 1) + `.png`";
Gauge1->Layers->Count = 5;
Gauge1->EndUpdate();

C#

exgauge1.BeginUpdate();
exgauge1.PicturesPath = "C:\\Program Files\\Exontrol\\ExGauge\\Sample\\Design\\Circular\\Knob 2";
exgauge1.PicturesName = "`Layer` + str(value + 1) + `.png`";
exgauge1.Layers.Count = 5;
exgauge1.EndUpdate();

JScript/JavaScript

<BODY onload="Init()">
<OBJECT CLASSID="clsid:91628F12-393C-44EF-A558-83ED1790AAD3" id="Gauge1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
	Gauge1.BeginUpdate();
	Gauge1.PicturesPath = "C:\\Program Files\\Exontrol\\ExGauge\\Sample\\Design\\Circular\\Knob 2";
	Gauge1.PicturesName = "`Layer` + str(value + 1) + `.png`";
	Gauge1.Layers.Count = 5;
	Gauge1.EndUpdate();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload="Init()">
<OBJECT CLASSID="clsid:91628F12-393C-44EF-A558-83ED1790AAD3" id="Gauge1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
	With Gauge1
		.BeginUpdate 
		.PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Knob 2"
		.PicturesName = "`Layer` + str(value + 1) + `.png`"
		.Layers.Count = 5
		.EndUpdate 
	End With
End Function
</SCRIPT>
</BODY>

C# for /COM

axGauge1.BeginUpdate();
axGauge1.PicturesPath = "C:\\Program Files\\Exontrol\\ExGauge\\Sample\\Design\\Circular\\Knob 2";
axGauge1.PicturesName = "`Layer` + str(value + 1) + `.png`";
axGauge1.Layers.Count = 5;
axGauge1.EndUpdate();

X++ (Dynamics Ax 2009)

public void init()
{
	;

	super();

	exgauge1.BeginUpdate();
	exgauge1.PicturesPath("C:\\Program Files\\Exontrol\\ExGauge\\Sample\\Design\\Circular\\Knob 2");
	exgauge1.PicturesName("`Layer` + str(value + 1) + `.png`");
	exgauge1.Layers().Count(5);
	exgauge1.EndUpdate();
}

Delphi 8 (.NET only)

with AxGauge1 do
begin
	BeginUpdate();
	PicturesPath := 'C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Knob 2';
	PicturesName := '`Layer` + str(value + 1) + `.png`';
	Layers.Count := 5;
	EndUpdate();
end

Delphi (standard)

with Gauge1 do
begin
	BeginUpdate();
	PicturesPath := 'C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Knob 2';
	PicturesName := '`Layer` + str(value + 1) + `.png`';
	Layers.Count := 5;
	EndUpdate();
end

VFP

with thisform.Gauge1
	.BeginUpdate
	.PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Knob 2"
	.PicturesName = "`Layer` + str(value + 1) + `.png`"
	.Layers.Count = 5
	.EndUpdate
endwith

dBASE Plus

local oGauge

oGauge = form.EXGAUGEACTIVEXCONTROL1.nativeObject
oGauge.BeginUpdate()
oGauge.PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Knob 2"
oGauge.PicturesName = "`Layer` + str(value + 1) + `.png`"
oGauge.Layers.Count = 5
oGauge.EndUpdate()

XBasic (Alpha Five)

Dim oGauge as P

oGauge = topparent:CONTROL_ACTIVEX1.activex
oGauge.BeginUpdate()
oGauge.PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Knob 2"
oGauge.PicturesName = "`Layer` + str(value + 1) + `.png`"
oGauge.Layers.Count = 5
oGauge.EndUpdate()

Visual Objects


oDCOCX_Exontrol1:BeginUpdate()
oDCOCX_Exontrol1:PicturesPath := "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Knob 2"
oDCOCX_Exontrol1:PicturesName := "`Layer` + str(value + 1) + `.png`"
oDCOCX_Exontrol1:Layers:Count := 5
oDCOCX_Exontrol1:EndUpdate()

PowerBuilder

OleObject oGauge

oGauge = ole_1.Object
oGauge.BeginUpdate()
oGauge.PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Knob 2"
oGauge.PicturesName = "`Layer` + str(value + 1) + `.png`"
oGauge.Layers.Count = 5
oGauge.EndUpdate()

Visual DataFlex

Procedure OnCreate
	Forward Send OnCreate
	Send ComBeginUpdate
	Set ComPicturesPath to "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Knob 2"
	Set ComPicturesName to "`Layer` + str(value + 1) + `.png`"
	Variant voLayers
	Get ComLayers to voLayers
	Handle hoLayers
	Get Create (RefClass(cComLayers)) to hoLayers
	Set pvComObject of hoLayers to voLayers
		Set ComCount of hoLayers to 5
	Send Destroy to hoLayers
	Send ComEndUpdate
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oGauge

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oGauge := XbpActiveXControl():new( oForm:drawingArea )
	oGauge:CLSID  := "Exontrol.Gauge.1" /*{91628F12-393C-44EF-A558-83ED1790AAD3}*/
	oGauge:create(,, {10,60},{610,370} )

		oGauge:BeginUpdate()
		oGauge:PicturesPath := "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Knob 2"
		oGauge:PicturesName := "`Layer` + str(value + 1) + `.png`"
		oGauge:Layers():Count := 5
		oGauge:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN