exslider - sample code

How can I change the color of the selection in the control?

VBA (MS Access, Excell...)

With Slider1
	.SelectRange = True
	.SelStart = 2
	.SelLength = 2
	.Value = 1
	.Background(408) = RGB(255,0,0)
End With

VB6

With Slider1
	.SelectRange = True
	.SelStart = 2
	.SelLength = 2
	.Value = 1
	.Background(exHSSel) = RGB(255,0,0)
End With

VB.NET

With Exslider1
	.SelectRange = True
	.SelStart = 2
	.SelLength = 2
	.Value = 1
	.set_Background(exontrol.EXSLIDERLib.BackgroundPartEnum.exHSSel,Color.FromArgb(255,0,0))
End With

VB.NET for /COM

With AxSlider1
	.SelectRange = True
	.SelStart = 2
	.SelLength = 2
	.Value = 1
	.set_Background(EXSLIDERLib.BackgroundPartEnum.exHSSel,255)
End With

C++

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

	#import <ExSlider.dll>
	using namespace EXSLIDERLib;
*/
EXSLIDERLib::ISliderPtr spSlider1 = GetDlgItem(IDC_SLIDER1)->GetControlUnknown();
spSlider1->PutSelectRange(VARIANT_TRUE);
spSlider1->PutSelStart(2);
spSlider1->PutSelLength(2);
spSlider1->PutValue(1);
spSlider1->PutBackground(EXSLIDERLib::exHSSel,RGB(255,0,0));

C++ Builder

Slider1->SelectRange = true;
Slider1->SelStart = 2;
Slider1->SelLength = 2;
Slider1->Value = 1;
Slider1->Background[Exsliderlib_tlb::BackgroundPartEnum::exHSSel] = RGB(255,0,0);

C#

exslider1.SelectRange = true;
exslider1.SelStart = 2;
exslider1.SelLength = 2;
exslider1.Value = 1;
exslider1.set_Background(exontrol.EXSLIDERLib.BackgroundPartEnum.exHSSel,Color.FromArgb(255,0,0));

JavaScript

<OBJECT classid="clsid:031F9B36-1219-4DF5-8E09-1A50B8185BC2" id="Slider1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
	Slider1.SelectRange = true;
	Slider1.SelStart = 2;
	Slider1.SelLength = 2;
	Slider1.Value = 1;
	Slider1.Background(408) = 255;
</SCRIPT>

C# for /COM

axSlider1.SelectRange = true;
axSlider1.SelStart = 2;
axSlider1.SelLength = 2;
axSlider1.Value = 1;
axSlider1.set_Background(EXSLIDERLib.BackgroundPartEnum.exHSSel,(uint)ColorTranslator.ToWin32(Color.FromArgb(255,0,0)));

X++ (Dynamics Ax 2009)

public void init()
{
	;

	super();

	exslider1.SelectRange(true);
	exslider1.SelStart(2);
	exslider1.SelLength(2);
	exslider1.Value(1);
	exslider1.Background(408/*exHSSel*/,WinApi::RGB2int(255,0,0));
}

Delphi 8 (.NET only)

with AxSlider1 do
begin
	SelectRange := True;
	SelStart := 2;
	SelLength := 2;
	Value := 1;
	set_Background(EXSLIDERLib.BackgroundPartEnum.exHSSel,$ff);
end

Delphi (standard)

with Slider1 do
begin
	SelectRange := True;
	SelStart := 2;
	SelLength := 2;
	Value := 1;
	Background[EXSLIDERLib_TLB.exHSSel] := $ff;
end

VFP

with thisform.Slider1
	.SelectRange = .T.
	.SelStart = 2
	.SelLength = 2
	.Value = 1
	.Object.Background(408) = RGB(255,0,0)
endwith

dBASE Plus

local oSlider

oSlider = form.Activex1.nativeObject
oSlider.SelectRange = true
oSlider.SelStart = 2
oSlider.SelLength = 2
oSlider.Value = 1
oSlider.Template = [Background(408) = 0xff] // oSlider.Background(408) = 0xff

XBasic (Alpha Five)

Dim oSlider as P

oSlider = topparent:CONTROL_ACTIVEX1.activex
oSlider.SelectRange = .t.
oSlider.SelStart = 2
oSlider.SelLength = 2
oSlider.Value = 1
oSlider.Template = "Background(408) = 255" ' oSlider.Background(408) = 255

Visual Objects


oDCOCX_Exontrol1:SelectRange := true
oDCOCX_Exontrol1:SelStart := 2
oDCOCX_Exontrol1:SelLength := 2
oDCOCX_Exontrol1:Value := 1
oDCOCX_Exontrol1:[Background,exHSSel] := RGB(255,0,0)

PowerBuilder

OleObject oSlider

oSlider = ole_1.Object
oSlider.SelectRange = true
oSlider.SelStart = 2
oSlider.SelLength = 2
oSlider.Value = 1
oSlider.Background(408,RGB(255,0,0))

Visual DataFlex

Procedure OnCreate
	Forward Send OnCreate
	Set ComSelectRange to True
	Set ComSelStart to 2
	Set ComSelLength to 2
	Set ComValue to 1
	Set ComBackground OLEexHSSel to (RGB(255,0,0))
End_Procedure

XBase++

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

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

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

	oSlider := XbpActiveXControl():new( oForm:drawingArea )
	oSlider:CLSID  := "Exontrol.Slider.1" /*{031F9B36-1219-4DF5-8E09-1A50B8185BC2}*/
	oSlider:create(,, {10,60},{610,370} )

		oSlider:SelectRange := .T.
		oSlider:SelStart := 2
		oSlider:SelLength := 2
		oSlider:Value := 1
		oSlider:SetProperty("Background",408/*exHSSel*/,0xff)

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