property Layer.Value as Variant
Indicates the object's value.

TypeDescription
Variant A VARIANT expression that specifies the value associated with the layer.
By default, the Value property is empty. The layer's Value could indicate its offset or its rotation angle, based on the OnDrag property. The OnDrag property indicates the action to be performed when the user drags the layer ( dragable ).  Use the Value property of the Clip object to associate a value with the layer's clipping region. Each layer can associate a value with it, while the control's Value property can be associated through the LayerOfValue property with the value of one of the layers within the control.

For instance:

The Change event occurs when the layer's Value property is changed. During the Change event, you can change values of other layers as well. For instance, if the second-hand of the clock is rotated, you can rotate the hour and the minute-hands of the clock as well. The DragStart / Drag / DragEnd events notify your application when a layer is dragged. You can call DragInfo.Debug = -1 during the DragStart event to display debugging information like current movement, rotation angle when drag operation is performed.

The Value property indicates the value keyword in the following properties:

The Value property works in association with the layer's OnDrag property like follows:

For instance, having the gauge from the C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Guage folder, which includes the background and the needle pictures:

we need to define the value of the needle to be between 0 and 100, so if we call Value property on 85 we should get something like:

In conclusion, what we need to do is:

The following samples shows how you can do that:

VBA (MS Access, Excell...)

With Gauge1
	.BeginUpdate 
	.DefaultLayer(185) = 2
	.BackColor = RGB(217,217,217)
	.PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Guage"
	With .Layers.Add("background")
		.Background.Picture.Name = "Guage_Background.png"
		.RotateCenterY = "lheight/2 + 78"
	End With
	With .Layers.Add("needle")
		.Background.Picture.Name = "Guage_Needle.png"
		.OnDrag = 2
		.RotateAngleValid = "value < 90 ? value : (value < 180 ? 90 : ( value < 270 ? 270 : value ))"
		.RotateAngleToValue = "value >= 270 ? (value - 270)/90*50 : (value/90)*50 + 50"
		.ValueToRotateAngle = "value < 50 ? (270 + value/50*90) : (value - 50)/50 * 90"
	End With
	.Value = 85
	.EndUpdate 
End With

VB6

With Gauge1
	.BeginUpdate 
	.DefaultLayer(exDefLayerRotateType) = 2
	.BackColor = RGB(217,217,217)
	.PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Guage"
	With .Layers.Add("background")
		.Background.Picture.Name = "Guage_Background.png"
		.RotateCenterY = "lheight/2 + 78"
	End With
	With .Layers.Add("needle")
		.Background.Picture.Name = "Guage_Needle.png"
		.OnDrag = exDoRotate
		.RotateAngleValid = "value < 90 ? value : (value < 180 ? 90 : ( value < 270 ? 270 : value ))"
		.RotateAngleToValue = "value >= 270 ? (value - 270)/90*50 : (value/90)*50 + 50"
		.ValueToRotateAngle = "value < 50 ? (270 + value/50*90) : (value - 50)/50 * 90"
	End With
	.Value = 85
	.EndUpdate 
End With

VB.NET

With Exgauge1
	.BeginUpdate()
	.set_DefaultLayer(exontrol.EXGAUGELib.DefaultLayerPropertyEnum.exDefLayerRotateType,2)
	.BackColor = Color.FromArgb(217,217,217)
	.PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Guage"
	With .Layers.Add("background")
		.Background.Picture.Name = "Guage_Background.png"
		.RotateCenterY = "lheight/2 + 78"
	End With
	With .Layers.Add("needle")
		.Background.Picture.Name = "Guage_Needle.png"
		.OnDrag = exontrol.EXGAUGELib.OnDragLayerEnum.exDoRotate
		.RotateAngleValid = "value < 90 ? value : (value < 180 ? 90 : ( value < 270 ? 270 : value ))"
		.RotateAngleToValue = "value >= 270 ? (value - 270)/90*50 : (value/90)*50 + 50"
		.ValueToRotateAngle = "value < 50 ? (270 + value/50*90) : (value - 50)/50 * 90"
	End With
	.Value = 85
	.EndUpdate()
End With

VB.NET for /COM

With AxGauge1
	.BeginUpdate()
	.set_DefaultLayer(EXGAUGELib.DefaultLayerPropertyEnum.exDefLayerRotateType,2)
	.BackColor = RGB(217,217,217)
	.PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Guage"
	With .Layers.Add("background")
		.Background.Picture.Name = "Guage_Background.png"
		.RotateCenterY = "lheight/2 + 78"
	End With
	With .Layers.Add("needle")
		.Background.Picture.Name = "Guage_Needle.png"
		.OnDrag = EXGAUGELib.OnDragLayerEnum.exDoRotate
		.RotateAngleValid = "value < 90 ? value : (value < 180 ? 90 : ( value < 270 ? 270 : value ))"
		.RotateAngleToValue = "value >= 270 ? (value - 270)/90*50 : (value/90)*50 + 50"
		.ValueToRotateAngle = "value < 50 ? (270 + value/50*90) : (value - 50)/50 * 90"
	End With
	.Value = 85
	.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->PutDefaultLayer(EXGAUGELib::exDefLayerRotateType,long(2));
spGauge1->PutBackColor(RGB(217,217,217));
spGauge1->PutPicturesPath(L"C:\\Program Files\\Exontrol\\ExGauge\\Sample\\Design\\Circular\\Guage");
EXGAUGELib::ILayerPtr var_Layer = spGauge1->GetLayers()->Add("background");
	var_Layer->GetBackground()->GetPicture()->PutName("Guage_Background.png");
	var_Layer->PutRotateCenterY(L"lheight/2 + 78");
EXGAUGELib::ILayerPtr var_Layer1 = spGauge1->GetLayers()->Add("needle");
	var_Layer1->GetBackground()->GetPicture()->PutName("Guage_Needle.png");
	var_Layer1->PutOnDrag(EXGAUGELib::exDoRotate);
	var_Layer1->PutRotateAngleValid(L"value < 90 ? value : (value < 180 ? 90 : ( value < 270 ? 270 : value ))");
	var_Layer1->PutRotateAngleToValue(L"value >= 270 ? (value - 270)/90*50 : (value/90)*50 + 50");
	var_Layer1->PutValueToRotateAngle(L"value < 50 ? (270 + value/50*90) : (value - 50)/50 * 90");
spGauge1->PutValue(long(85));
spGauge1->EndUpdate();

C++ Builder

Gauge1->BeginUpdate();
Gauge1->DefaultLayer[Exgaugelib_tlb::DefaultLayerPropertyEnum::exDefLayerRotateType] = TVariant(2);
Gauge1->BackColor = RGB(217,217,217);
Gauge1->PicturesPath = L"C:\\Program Files\\Exontrol\\ExGauge\\Sample\\Design\\Circular\\Guage";
Exgaugelib_tlb::ILayerPtr var_Layer = Gauge1->Layers->Add(TVariant("background"));
	var_Layer->Background->Picture->set_Name(TVariant("Guage_Background.png"));
	var_Layer->RotateCenterY = L"lheight/2 + 78";
Exgaugelib_tlb::ILayerPtr var_Layer1 = Gauge1->Layers->Add(TVariant("needle"));
	var_Layer1->Background->Picture->set_Name(TVariant("Guage_Needle.png"));
	var_Layer1->OnDrag = Exgaugelib_tlb::OnDragLayerEnum::exDoRotate;
	var_Layer1->RotateAngleValid = L"value < 90 ? value : (value < 180 ? 90 : ( value < 270 ? 270 : value ))";
	var_Layer1->RotateAngleToValue = L"value >= 270 ? (value - 270)/90*50 : (value/90)*50 + 50";
	var_Layer1->ValueToRotateAngle = L"value < 50 ? (270 + value/50*90) : (value - 50)/50 * 90";
Gauge1->set_Value(TVariant(85));
Gauge1->EndUpdate();

C#

exgauge1.BeginUpdate();
exgauge1.set_DefaultLayer(exontrol.EXGAUGELib.DefaultLayerPropertyEnum.exDefLayerRotateType,2);
exgauge1.BackColor = Color.FromArgb(217,217,217);
exgauge1.PicturesPath = "C:\\Program Files\\Exontrol\\ExGauge\\Sample\\Design\\Circular\\Guage";
exontrol.EXGAUGELib.Layer var_Layer = exgauge1.Layers.Add("background");
	var_Layer.Background.Picture.Name = "Guage_Background.png";
	var_Layer.RotateCenterY = "lheight/2 + 78";
exontrol.EXGAUGELib.Layer var_Layer1 = exgauge1.Layers.Add("needle");
	var_Layer1.Background.Picture.Name = "Guage_Needle.png";
	var_Layer1.OnDrag = exontrol.EXGAUGELib.OnDragLayerEnum.exDoRotate;
	var_Layer1.RotateAngleValid = "value < 90 ? value : (value < 180 ? 90 : ( value < 270 ? 270 : value ))";
	var_Layer1.RotateAngleToValue = "value >= 270 ? (value - 270)/90*50 : (value/90)*50 + 50";
	var_Layer1.ValueToRotateAngle = "value < 50 ? (270 + value/50*90) : (value - 50)/50 * 90";
exgauge1.Value = 85;
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.DefaultLayer(185) = 2;
	Gauge1.BackColor = 14277081;
	Gauge1.PicturesPath = "C:\\Program Files\\Exontrol\\ExGauge\\Sample\\Design\\Circular\\Guage";
	var var_Layer = Gauge1.Layers.Add("background");
		var_Layer.Background.Picture.Name = "Guage_Background.png";
		var_Layer.RotateCenterY = "lheight/2 + 78";
	var var_Layer1 = Gauge1.Layers.Add("needle");
		var_Layer1.Background.Picture.Name = "Guage_Needle.png";
		var_Layer1.OnDrag = 2;
		var_Layer1.RotateAngleValid = "value < 90 ? value : (value < 180 ? 90 : ( value < 270 ? 270 : value ))";
		var_Layer1.RotateAngleToValue = "value >= 270 ? (value - 270)/90*50 : (value/90)*50 + 50";
		var_Layer1.ValueToRotateAngle = "value < 50 ? (270 + value/50*90) : (value - 50)/50 * 90";
	Gauge1.Value = 85;
	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 
		.DefaultLayer(185) = 2
		.BackColor = RGB(217,217,217)
		.PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Guage"
		With .Layers.Add("background")
			.Background.Picture.Name = "Guage_Background.png"
			.RotateCenterY = "lheight/2 + 78"
		End With
		With .Layers.Add("needle")
			.Background.Picture.Name = "Guage_Needle.png"
			.OnDrag = 2
			.RotateAngleValid = "value < 90 ? value : (value < 180 ? 90 : ( value < 270 ? 270 : value ))"
			.RotateAngleToValue = "value >= 270 ? (value - 270)/90*50 : (value/90)*50 + 50"
			.ValueToRotateAngle = "value < 50 ? (270 + value/50*90) : (value - 50)/50 * 90"
		End With
		.Value = 85
		.EndUpdate 
	End With
End Function
</SCRIPT>
</BODY>

C# for /COM

axGauge1.BeginUpdate();
axGauge1.set_DefaultLayer(EXGAUGELib.DefaultLayerPropertyEnum.exDefLayerRotateType,2);
axGauge1.BackColor = Color.FromArgb(217,217,217);
axGauge1.PicturesPath = "C:\\Program Files\\Exontrol\\ExGauge\\Sample\\Design\\Circular\\Guage";
EXGAUGELib.Layer var_Layer = axGauge1.Layers.Add("background");
	var_Layer.Background.Picture.Name = "Guage_Background.png";
	var_Layer.RotateCenterY = "lheight/2 + 78";
EXGAUGELib.Layer var_Layer1 = axGauge1.Layers.Add("needle");
	var_Layer1.Background.Picture.Name = "Guage_Needle.png";
	var_Layer1.OnDrag = EXGAUGELib.OnDragLayerEnum.exDoRotate;
	var_Layer1.RotateAngleValid = "value < 90 ? value : (value < 180 ? 90 : ( value < 270 ? 270 : value ))";
	var_Layer1.RotateAngleToValue = "value >= 270 ? (value - 270)/90*50 : (value/90)*50 + 50";
	var_Layer1.ValueToRotateAngle = "value < 50 ? (270 + value/50*90) : (value - 50)/50 * 90";
axGauge1.Value = 85;
axGauge1.EndUpdate();

X++ (Dynamics Ax 2009)

public void init()
{
	COM com_Background,com_Layer,com_Layer1,com_Picture;
	anytype var_Background,var_Layer,var_Layer1,var_Picture;
	;

	super();

	exgauge1.BeginUpdate();
	exgauge1.DefaultLayer(185/*exDefLayerRotateType*/,COMVariant::createFromInt(2));
	exgauge1.BackColor(WinApi::RGB2int(217,217,217));
	exgauge1.PicturesPath("C:\\Program Files\\Exontrol\\ExGauge\\Sample\\Design\\Circular\\Guage");
	var_Layer = COM::createFromObject(exgauge1.Layers()).Add("background"); com_Layer = var_Layer;
		var_Background = COM::createFromObject(com_Layer.Background()); com_Background = var_Background;
		var_Picture = COM::createFromObject(com_Background).Picture(); com_Picture = var_Picture;
		com_Picture.Name("Guage_Background.png");
		com_Layer.RotateCenterY("lheight/2 + 78");
	var_Layer1 = COM::createFromObject(exgauge1.Layers()).Add("needle"); com_Layer1 = var_Layer1;
		var_Background = COM::createFromObject(com_Layer1.Background()); com_Background = var_Background;
		var_Picture = COM::createFromObject(com_Background).Picture(); com_Picture = var_Picture;
		com_Picture.Name("Guage_Needle.png");
		com_Layer1.OnDrag(2/*exDoRotate*/);
		com_Layer1.RotateAngleValid("value < 90 ? value : (value < 180 ? 90 : ( value < 270 ? 270 : value ))");
		com_Layer1.RotateAngleToValue("value >= 270 ? (value - 270)/90*50 : (value/90)*50 + 50");
		com_Layer1.ValueToRotateAngle("value < 50 ? (270 + value/50*90) : (value - 50)/50 * 90");
	exgauge1.Value(COMVariant::createFromInt(85));
	exgauge1.EndUpdate();
}

Delphi 8 (.NET only)

with AxGauge1 do
begin
	BeginUpdate();
	set_DefaultLayer(EXGAUGELib.DefaultLayerPropertyEnum.exDefLayerRotateType,TObject(2));
	BackColor := Color.FromArgb(217,217,217);
	PicturesPath := 'C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Guage';
	with Layers.Add('background') do
	begin
		Background.Picture.Name := 'Guage_Background.png';
		RotateCenterY := 'lheight/2 + 78';
	end;
	with Layers.Add('needle') do
	begin
		Background.Picture.Name := 'Guage_Needle.png';
		OnDrag := EXGAUGELib.OnDragLayerEnum.exDoRotate;
		RotateAngleValid := 'value < 90 ? value : (value < 180 ? 90 : ( value < 270 ? 270 : value ))';
		RotateAngleToValue := 'value >= 270 ? (value - 270)/90*50 : (value/90)*50 + 50';
		ValueToRotateAngle := 'value < 50 ? (270 + value/50*90) : (value - 50)/50 * 90';
	end;
	Value := TObject(85);
	EndUpdate();
end

Delphi (standard)

with Gauge1 do
begin
	BeginUpdate();
	DefaultLayer[EXGAUGELib_TLB.exDefLayerRotateType] := OleVariant(2);
	BackColor := RGB(217,217,217);
	PicturesPath := 'C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Guage';
	with Layers.Add('background') do
	begin
		Background.Picture.Name := 'Guage_Background.png';
		RotateCenterY := 'lheight/2 + 78';
	end;
	with Layers.Add('needle') do
	begin
		Background.Picture.Name := 'Guage_Needle.png';
		OnDrag := EXGAUGELib_TLB.exDoRotate;
		RotateAngleValid := 'value < 90 ? value : (value < 180 ? 90 : ( value < 270 ? 270 : value ))';
		RotateAngleToValue := 'value >= 270 ? (value - 270)/90*50 : (value/90)*50 + 50';
		ValueToRotateAngle := 'value < 50 ? (270 + value/50*90) : (value - 50)/50 * 90';
	end;
	Value := OleVariant(85);
	EndUpdate();
end

VFP

with thisform.Gauge1
	.BeginUpdate
	.Object.DefaultLayer(185) = 2
	.BackColor = RGB(217,217,217)
	.PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Guage"
	with .Layers.Add("background")
		.Background.Picture.Name = "Guage_Background.png"
		.RotateCenterY = "lheight/2 + 78"
	endwith
	with .Layers.Add("needle")
		.Background.Picture.Name = "Guage_Needle.png"
		.OnDrag = 2
		.RotateAngleValid = "value < 90 ? value : (value < 180 ? 90 : ( value < 270 ? 270 : value ))"
		.RotateAngleToValue = "value >= 270 ? (value - 270)/90*50 : (value/90)*50 + 50"
		.ValueToRotateAngle = "value < 50 ? (270 + value/50*90) : (value - 50)/50 * 90"
	endwith
	.Value = 85
	.EndUpdate
endwith

dBASE Plus

local oGauge,var_Layer,var_Layer1

oGauge = form.EXGAUGEACTIVEXCONTROL1.nativeObject
oGauge.BeginUpdate()
oGauge.Template = [DefaultLayer(185) = 2] // oGauge.DefaultLayer(185) = 2
oGauge.BackColor = 0xd9d9d9
oGauge.PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Guage"
var_Layer = oGauge.Layers.Add("background")
	var_Layer.Background.Picture.Name = "Guage_Background.png"
	var_Layer.RotateCenterY = "lheight/2 + 78"
var_Layer1 = oGauge.Layers.Add("needle")
	var_Layer1.Background.Picture.Name = "Guage_Needle.png"
	var_Layer1.OnDrag = 2
	var_Layer1.RotateAngleValid = "value < 90 ? value : (value < 180 ? 90 : ( value < 270 ? 270 : value ))"
	var_Layer1.RotateAngleToValue = "value >= 270 ? (value - 270)/90*50 : (value/90)*50 + 50"
	var_Layer1.ValueToRotateAngle = "value < 50 ? (270 + value/50*90) : (value - 50)/50 * 90"
oGauge.Value = 85
oGauge.EndUpdate()

XBasic (Alpha Five)

Dim oGauge as P
Dim var_Layer as P
Dim var_Layer1 as P

oGauge = topparent:CONTROL_ACTIVEX1.activex
oGauge.BeginUpdate()
oGauge.Template = "DefaultLayer(185) = 2" // oGauge.DefaultLayer(185) = 2
oGauge.BackColor = 14277081
oGauge.PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Guage"
var_Layer = oGauge.Layers.Add("background")
	var_Layer.Background.Picture.Name = "Guage_Background.png"
	var_Layer.RotateCenterY = "lheight/2 + 78"
var_Layer1 = oGauge.Layers.Add("needle")
	var_Layer1.Background.Picture.Name = "Guage_Needle.png"
	var_Layer1.OnDrag = 2
	var_Layer1.RotateAngleValid = "value < 90 ? value : (value < 180 ? 90 : ( value < 270 ? 270 : value ))"
	var_Layer1.RotateAngleToValue = "value >= 270 ? (value - 270)/90*50 : (value/90)*50 + 50"
	var_Layer1.ValueToRotateAngle = "value < 50 ? (270 + value/50*90) : (value - 50)/50 * 90"
oGauge.Value = 85
oGauge.EndUpdate()

Visual Objects

local var_Layer,var_Layer1 as ILayer

oDCOCX_Exontrol1:BeginUpdate()
oDCOCX_Exontrol1:[DefaultLayer,exDefLayerRotateType] := 2
oDCOCX_Exontrol1:BackColor := RGB(217,217,217)
oDCOCX_Exontrol1:PicturesPath := "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Guage"
var_Layer := oDCOCX_Exontrol1:Layers:Add("background")
	var_Layer:Background:Picture:Name := "Guage_Background.png"
	var_Layer:RotateCenterY := "lheight/2 + 78"
var_Layer1 := oDCOCX_Exontrol1:Layers:Add("needle")
	var_Layer1:Background:Picture:Name := "Guage_Needle.png"
	var_Layer1:OnDrag := exDoRotate
	var_Layer1:RotateAngleValid := "value < 90 ? value : (value < 180 ? 90 : ( value < 270 ? 270 : value ))"
	var_Layer1:RotateAngleToValue := "value >= 270 ? (value - 270)/90*50 : (value/90)*50 + 50"
	var_Layer1:ValueToRotateAngle := "value < 50 ? (270 + value/50*90) : (value - 50)/50 * 90"
oDCOCX_Exontrol1:Value := 85
oDCOCX_Exontrol1:EndUpdate()

PowerBuilder

OleObject oGauge,var_Layer,var_Layer1

oGauge = ole_1.Object
oGauge.BeginUpdate()
oGauge.DefaultLayer(185,2)
oGauge.BackColor = RGB(217,217,217)
oGauge.PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Guage"
var_Layer = oGauge.Layers.Add("background")
	var_Layer.Background.Picture.Name = "Guage_Background.png"
	var_Layer.RotateCenterY = "lheight/2 + 78"
var_Layer1 = oGauge.Layers.Add("needle")
	var_Layer1.Background.Picture.Name = "Guage_Needle.png"
	var_Layer1.OnDrag = 2
	var_Layer1.RotateAngleValid = "value < 90 ? value : (value < 180 ? 90 : ( value < 270 ? 270 : value ))"
	var_Layer1.RotateAngleToValue = "value >= 270 ? (value - 270)/90*50 : (value/90)*50 + 50"
	var_Layer1.ValueToRotateAngle = "value < 50 ? (270 + value/50*90) : (value - 50)/50 * 90"
oGauge.Value = 85
oGauge.EndUpdate()

Visual DataFlex

Procedure OnCreate
	Forward Send OnCreate
	Send ComBeginUpdate
	Set ComDefaultLayer OLEexDefLayerRotateType to 2
	Set ComBackColor to (RGB(217,217,217))
	Set ComPicturesPath to "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Guage"
	Variant voLayers
	Get ComLayers to voLayers
	Handle hoLayers
	Get Create (RefClass(cComLayers)) to hoLayers
	Set pvComObject of hoLayers to voLayers
		Variant voLayer
		Get ComAdd of hoLayers "background" to voLayer
		Handle hoLayer
		Get Create (RefClass(cComLayer)) to hoLayer
		Set pvComObject of hoLayer to voLayer
			Variant voBackground
			Get ComBackground of hoLayer to voBackground
			Handle hoBackground
			Get Create (RefClass(cComBackground)) to hoBackground
			Set pvComObject of hoBackground to voBackground
				Variant voPicture
				Get ComPicture of hoBackground to voPicture
				Handle hoPicture
				Get Create (RefClass(cComPicture)) to hoPicture
				Set pvComObject of hoPicture to voPicture
					Set ComName of hoPicture to "Guage_Background.png"
				Send Destroy to hoPicture
			Send Destroy to hoBackground
			Set ComRotateCenterY of hoLayer to "lheight/2 + 78"
		Send Destroy to hoLayer
	Send Destroy to hoLayers
	Variant voLayers1
	Get ComLayers to voLayers1
	Handle hoLayers1
	Get Create (RefClass(cComLayers)) to hoLayers1
	Set pvComObject of hoLayers1 to voLayers1
		Variant voLayer1
		Get ComAdd of hoLayers1 "needle" to voLayer1
		Handle hoLayer1
		Get Create (RefClass(cComLayer)) to hoLayer1
		Set pvComObject of hoLayer1 to voLayer1
			Variant voBackground1
			Get ComBackground of hoLayer1 to voBackground1
			Handle hoBackground1
			Get Create (RefClass(cComBackground)) to hoBackground1
			Set pvComObject of hoBackground1 to voBackground1
				Variant voPicture1
				Get ComPicture of hoBackground1 to voPicture1
				Handle hoPicture1
				Get Create (RefClass(cComPicture)) to hoPicture1
				Set pvComObject of hoPicture1 to voPicture1
					Set ComName of hoPicture1 to "Guage_Needle.png"
				Send Destroy to hoPicture1
			Send Destroy to hoBackground1
			Set ComOnDrag of hoLayer1 to OLEexDoRotate
			Set ComRotateAngleValid of hoLayer1 to "value < 90 ? value : (value < 180 ? 90 : ( value < 270 ? 270 : value ))"
			Set ComRotateAngleToValue of hoLayer1 to "value >= 270 ? (value - 270)/90*50 : (value/90)*50 + 50"
			Set ComValueToRotateAngle of hoLayer1 to "value < 50 ? (270 + value/50*90) : (value - 50)/50 * 90"
		Send Destroy to hoLayer1
	Send Destroy to hoLayers1
	Set ComValue to 85
	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
	LOCAL oLayer,oLayer1

	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:SetProperty("DefaultLayer",185/*exDefLayerRotateType*/,2)
		oGauge:SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 217,217,217 } )  , .F. ))
		oGauge:PicturesPath := "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Guage"
		oLayer := oGauge:Layers():Add("background")
			oLayer:Background():Picture():Name := "Guage_Background.png"
			oLayer:RotateCenterY := "lheight/2 + 78"
		oLayer1 := oGauge:Layers():Add("needle")
			oLayer1:Background():Picture():Name := "Guage_Needle.png"
			oLayer1:OnDrag := 2/*exDoRotate*/
			oLayer1:RotateAngleValid := "value < 90 ? value : (value < 180 ? 90 : ( value < 270 ? 270 : value ))"
			oLayer1:RotateAngleToValue := "value >= 270 ? (value - 270)/90*50 : (value/90)*50 + 50"
			oLayer1:ValueToRotateAngle := "value < 50 ? (270 + value/50*90) : (value - 50)/50 * 90"
		oGauge:Value := 85
		oGauge:EndUpdate()

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