property Element.Pattern as Pattern
Specifies the pattern to be shown on the element's background.

TypeDescription
Pattern A Pattern to be shown over the element's background.
By default, no Pattern is shown on the element's background. The Pattern property defines the pattern to be shown on the control's background. The BackColor property specifies the element's background color. Background(exElementBackColor) property specifies the default background color / visual appearance. The ForeColor property specifies the element's foreground color. The Picture property specifies the picture to be shown on the element's background. The PictureDisplay property specifies the way the element's picture is displayed on the element's background.

The following screen shot shows an element with different pattern:

 

The following samples applies a pattern like ( not available ) over the element:

VBA (MS Access, Excell...)

With Surface1
	With .Elements
		With .Add("Element+Pattern",-100).Pattern
			.Type = 6
			.Color = RGB(224,224,224)
		End With
		.Add "Element",100
	End With
End With

VB6

With Surface1
	With .Elements
		With .Add("Element+Pattern",-100).Pattern
			.Type = exPatternBDiagonal
			.Color = RGB(224,224,224)
		End With
		.Add "Element",100
	End With
End With

VB.NET

With Exsurface1
	With .Elements
		With .Add("Element+Pattern",-100).Pattern
			.Type = exontrol.EXSURFACELib.PatternEnum.exPatternBDiagonal
			.Color = Color.FromArgb(224,224,224)
		End With
		.Add("Element",100)
	End With
End With

VB.NET for /COM

With AxSurface1
	With .Elements
		With .Add("Element+Pattern",-100).Pattern
			.Type = EXSURFACELib.PatternEnum.exPatternBDiagonal
			.Color = RGB(224,224,224)
		End With
		.Add("Element",100)
	End With
End With

C++

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

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	EXSURFACELib::IPatternPtr var_Pattern = var_Elements->Add("Element+Pattern",long(-100),vtMissing,vtMissing,vtMissing,vtMissing)->GetPattern();
		var_Pattern->PutType(EXSURFACELib::exPatternBDiagonal);
		var_Pattern->PutColor(RGB(224,224,224));
	var_Elements->Add("Element",long(100),vtMissing,vtMissing,vtMissing,vtMissing);

C++ Builder

Exsurfacelib_tlb::IElementsPtr var_Elements = Surface1->Elements;
	Exsurfacelib_tlb::IPatternPtr var_Pattern = var_Elements->Add(TVariant("Element+Pattern"),TVariant(-100),TNoParam(),TNoParam(),TNoParam(),TNoParam())->Pattern;
		var_Pattern->Type = Exsurfacelib_tlb::PatternEnum::exPatternBDiagonal;
		var_Pattern->Color = RGB(224,224,224);
	var_Elements->Add(TVariant("Element"),TVariant(100),TNoParam(),TNoParam(),TNoParam(),TNoParam());

C#

exontrol.EXSURFACELib.Elements var_Elements = exsurface1.Elements;
	exontrol.EXSURFACELib.Pattern var_Pattern = var_Elements.Add("Element+Pattern",-100,null,null,null,null).Pattern;
		var_Pattern.Type = exontrol.EXSURFACELib.PatternEnum.exPatternBDiagonal;
		var_Pattern.Color = Color.FromArgb(224,224,224);
	var_Elements.Add("Element",100,null,null,null,null);

JavaScript

<OBJECT classid="clsid:AC1DF7F4-0919-4364-8167-2F9B5155EA4B" id="Surface1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
	var var_Elements = Surface1.Elements;
		var var_Pattern = var_Elements.Add("Element+Pattern",-100,null,null,null,null).Pattern;
			var_Pattern.Type = 6;
			var_Pattern.Color = 14737632;
		var_Elements.Add("Element",100,null,null,null,null);
</SCRIPT>

C# for /COM

EXSURFACELib.Elements var_Elements = axSurface1.Elements;
	EXSURFACELib.Pattern var_Pattern = var_Elements.Add("Element+Pattern",-100,null,null,null,null).Pattern;
		var_Pattern.Type = EXSURFACELib.PatternEnum.exPatternBDiagonal;
		var_Pattern.Color = (uint)ColorTranslator.ToWin32(Color.FromArgb(224,224,224));
	var_Elements.Add("Element",100,null,null,null,null);

X++ (Dynamics Ax 2009)

public void init()
{
	COM com_Element,com_Elements,com_Pattern;
	anytype var_Element,var_Elements,var_Pattern;
	;

	super();

	var_Elements = exsurface1.Elements(); com_Elements = var_Elements;
		var_Element = COM::createFromObject(com_Elements.Add("Element+Pattern",COMVariant::createFromInt(-100))); com_Element = var_Element;
		var_Pattern = com_Element.Pattern(); com_Pattern = var_Pattern;
			com_Pattern.Type(6/*exPatternBDiagonal*/);
			com_Pattern.Color(WinApi::RGB2int(224,224,224));
		com_Elements.Add("Element",COMVariant::createFromInt(100));
}

Delphi 8 (.NET only)

with AxSurface1 do
begin
	with Elements do
	begin
		with Add('Element+Pattern',TObject(-100),Nil,Nil,Nil,Nil).Pattern do
		begin
			Type := EXSURFACELib.PatternEnum.exPatternBDiagonal;
			Color := $e0e0e0;
		end;
		Add('Element',TObject(100),Nil,Nil,Nil,Nil);
	end;
end

Delphi (standard)

with Surface1 do
begin
	with Elements do
	begin
		with Add('Element+Pattern',OleVariant(-100),Null,Null,Null,Null).Pattern do
		begin
			Type := EXSURFACELib_TLB.exPatternBDiagonal;
			Color := $e0e0e0;
		end;
		Add('Element',OleVariant(100),Null,Null,Null,Null);
	end;
end

VFP

with thisform.Surface1
	with .Elements
		with .Add("Element+Pattern",-100).Pattern
			.Type = 6
			.Color = RGB(224,224,224)
		endwith
		.Add("Element",100)
	endwith
endwith

dBASE Plus

local oSurface,var_Elements,var_Pattern

oSurface = form.Activex1.nativeObject
var_Elements = oSurface.Elements
	var_Pattern = var_Elements.Add("Element+Pattern",-100).Pattern
		var_Pattern.Type = 6
		var_Pattern.Color = 0xe0e0e0
	var_Elements.Add("Element",100)

XBasic (Alpha Five)

Dim oSurface as P
Dim var_Elements as P
Dim var_Pattern as P

oSurface = topparent:CONTROL_ACTIVEX1.activex
var_Elements = oSurface.Elements
	var_Pattern = var_Elements.Add("Element+Pattern",-100).Pattern
		var_Pattern.Type = 6
		var_Pattern.Color = 14737632
	var_Elements.Add("Element",100)

Visual Objects

local var_Elements as IElements
local var_Pattern as IPattern

var_Elements := oDCOCX_Exontrol1:Elements
	var_Pattern := var_Elements:Add("Element+Pattern",-100,nil,nil,nil,nil):Pattern
		var_Pattern:Type := exPatternBDiagonal
		var_Pattern:Color := RGB(224,224,224)
	var_Elements:Add("Element",100,nil,nil,nil,nil)

PowerBuilder

OleObject oSurface,var_Elements,var_Pattern

oSurface = ole_1.Object
var_Elements = oSurface.Elements
	var_Pattern = var_Elements.Add("Element+Pattern",-100).Pattern
		var_Pattern.Type = 6
		var_Pattern.Color = RGB(224,224,224)
	var_Elements.Add("Element",100)

Visual DataFlex

Procedure OnCreate
	Forward Send OnCreate
	Variant voElements
	Get ComElements to voElements
	Handle hoElements
	Get Create (RefClass(cComElements)) to hoElements
	Set pvComObject of hoElements to voElements
		Variant voElement
		Get ComAdd of hoElements "Element+Pattern" -100 Nothing Nothing Nothing Nothing to voElement
		Handle hoElement
		Get Create (RefClass(cComElement)) to hoElement
		Set pvComObject of hoElement to voElement
			Variant voPattern
			Get ComPattern of hoElement to voPattern
			Handle hoPattern
			Get Create (RefClass(cComPattern)) to hoPattern
			Set pvComObject of hoPattern to voPattern
				Set ComType of hoPattern to OLEexPatternBDiagonal
				Set ComColor of hoPattern to (RGB(224,224,224))
			Send Destroy to hoPattern
		Send Destroy to hoElement
		Get ComAdd of hoElements "Element" 100 Nothing Nothing Nothing Nothing to Nothing
	Send Destroy to hoElements
End_Procedure

XBase++

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

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oElements
	LOCAL oPattern
	LOCAL oSurface

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

	oSurface := XbpActiveXControl():new( oForm:drawingArea )
	oSurface:CLSID  := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/
	oSurface:create(,, {10,60},{610,370} )

		oElements := oSurface:Elements()
			oPattern := oElements:Add("Element+Pattern",-100):Pattern()
				oPattern:Type := 6/*exPatternBDiagonal*/
				oPattern:SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor  ( { 224,224,224 } )  , .F. ))
			oElements:Add("Element",100)

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