exlabel - sample code

Does your control support text decorations?

VBA (MS Access, Excell...)

With Label1
	.WordWrap = True
	.Caption = "<font ;32><sha ;;0><out><gra FFFFFF>gradient-bottom</gra><br><fgcolor=FFFFFF><gra 000000>gradie" & _
"nt-top</gra></fgcolor><br><fgcolor=000000><gra F0F0F0;1;1>center-gradient</gra></fgcolor><br><sh" & _
"a><out><gra FFFFFF>gradient-bottom</gra><br><fgcolor=FFFFFF><gra 000000>gradient-top</gra></fgco" & _
"lor><br><fgcolor=000000><gra F0F0F0;1;1>center-gradient</gra></fgcolor><br>"
End With

VB6

With Label1
	.WordWrap = True
	.Caption = "<font ;32><sha ;;0><out><gra FFFFFF>gradient-bottom</gra><br><fgcolor=FFFFFF><gra 000000>gradie" & _
"nt-top</gra></fgcolor><br><fgcolor=000000><gra F0F0F0;1;1>center-gradient</gra></fgcolor><br><sh" & _
"a><out><gra FFFFFF>gradient-bottom</gra><br><fgcolor=FFFFFF><gra 000000>gradient-top</gra></fgco" & _
"lor><br><fgcolor=000000><gra F0F0F0;1;1>center-gradient</gra></fgcolor><br>"
End With

VB.NET

With Exlabel1
	.WordWrap = True
	.Caption = "<font ;32><sha ;;0><out><gra FFFFFF>gradient-bottom</gra><br><fgcolor=FFFFFF><gra 000000>gradie" & _
"nt-top</gra></fgcolor><br><fgcolor=000000><gra F0F0F0;1;1>center-gradient</gra></fgcolor><br><sh" & _
"a><out><gra FFFFFF>gradient-bottom</gra><br><fgcolor=FFFFFF><gra 000000>gradient-top</gra></fgco" & _
"lor><br><fgcolor=000000><gra F0F0F0;1;1>center-gradient</gra></fgcolor><br>"
End With

VB.NET for /COM

With AxLabel1
	.WordWrap = True
	.Caption = "<font ;32><sha ;;0><out><gra FFFFFF>gradient-bottom</gra><br><fgcolor=FFFFFF><gra 000000>gradie" & _
"nt-top</gra></fgcolor><br><fgcolor=000000><gra F0F0F0;1;1>center-gradient</gra></fgcolor><br><sh" & _
"a><out><gra FFFFFF>gradient-bottom</gra><br><fgcolor=FFFFFF><gra 000000>gradient-top</gra></fgco" & _
"lor><br><fgcolor=000000><gra F0F0F0;1;1>center-gradient</gra></fgcolor><br>"
End With

C++

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

	#import <ExLabel.dll>
	using namespace EXLABELLib;
*/
EXLABELLib::ILabelPtr spLabel1 = GetDlgItem(IDC_LABEL1)->GetControlUnknown();
spLabel1->PutWordWrap(VARIANT_TRUE);
spLabel1->PutCaption(_bstr_t("<font ;32><sha ;;0><out><gra FFFFFF>gradient-bottom</gra><br><fgcolor=FFFFFF><gra 000000>gradie") +
"nt-top</gra></fgcolor><br><fgcolor=000000><gra F0F0F0;1;1>center-gradient</gra></fgcolor><br><sh" +
"a><out><gra FFFFFF>gradient-bottom</gra><br><fgcolor=FFFFFF><gra 000000>gradient-top</gra></fgco" +
"lor><br><fgcolor=000000><gra F0F0F0;1;1>center-gradient</gra></fgcolor><br>");

C++ Builder

Label1->WordWrap = true;
Label1->Caption = TVariant(String("<font ;32><sha ;;0><out><gra FFFFFF>gradient-bottom</gra><br><fgcolor=FFFFFF><gra 000000>gradie") +
"nt-top</gra></fgcolor><br><fgcolor=000000><gra F0F0F0;1;1>center-gradient</gra></fgcolor><br><sh" +
"a><out><gra FFFFFF>gradient-bottom</gra><br><fgcolor=FFFFFF><gra 000000>gradient-top</gra></fgco" +
"lor><br><fgcolor=000000><gra F0F0F0;1;1>center-gradient</gra></fgcolor><br>");

C#

exlabel1.WordWrap = true;
exlabel1.Caption = "<font ;32><sha ;;0><out><gra FFFFFF>gradient-bottom</gra><br><fgcolor=FFFFFF><gra 000000>gradie" +
"nt-top</gra></fgcolor><br><fgcolor=000000><gra F0F0F0;1;1>center-gradient</gra></fgcolor><br><sh" +
"a><out><gra FFFFFF>gradient-bottom</gra><br><fgcolor=FFFFFF><gra 000000>gradient-top</gra></fgco" +
"lor><br><fgcolor=000000><gra F0F0F0;1;1>center-gradient</gra></fgcolor><br>";

JavaScript

<OBJECT classid="clsid:09ABB057-BBDE-49A6-B5CB-B05197CD337B" id="Label1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
	Label1.WordWrap = true;
	Label1.Caption = "<font ;32><sha ;;0><out><gra FFFFFF>gradient-bottom</gra><br><fgcolor=FFFFFF><gra 000000>gradie" +
	"nt-top</gra></fgcolor><br><fgcolor=000000><gra F0F0F0;1;1>center-gradient</gra></fgcolor><br><sh" +
	"a><out><gra FFFFFF>gradient-bottom</gra><br><fgcolor=FFFFFF><gra 000000>gradient-top</gra></fgco" +
	"lor><br><fgcolor=000000><gra F0F0F0;1;1>center-gradient</gra></fgcolor><br>";
</SCRIPT>

C# for /COM

axLabel1.WordWrap = true;
axLabel1.Caption = "<font ;32><sha ;;0><out><gra FFFFFF>gradient-bottom</gra><br><fgcolor=FFFFFF><gra 000000>gradie" +
"nt-top</gra></fgcolor><br><fgcolor=000000><gra F0F0F0;1;1>center-gradient</gra></fgcolor><br><sh" +
"a><out><gra FFFFFF>gradient-bottom</gra><br><fgcolor=FFFFFF><gra 000000>gradient-top</gra></fgco" +
"lor><br><fgcolor=000000><gra F0F0F0;1;1>center-gradient</gra></fgcolor><br>";

X++ (Dynamics Ax 2009)

public void init()
{
	str var_s;
	;

	super();

	exlabel1.WordWrap(true);
	var_s = "<font ;32><sha ;;0><out><gra FFFFFF>gradient-bottom</gra><br><fgcolor=FFFFFF><gra 000000>gradien";
	var_s = var_s + "t-top</gra></fgcolor><br><fgcolor=000000><gra F0F0F0;1;1>center-gradient</gra></fgcolor><br><sha";
	var_s = var_s + "><out><gra FFFFFF>gradient-bottom</gra><br><fgcolor=FFFFFF><gra 000000>gradient-top</gra></fgcol";
	var_s = var_s + "or><br><fgcolor=000000><gra F0F0F0;1;1>center-gradient</gra></fgcolor><br>";
	exlabel1.Caption(var_s);
}

Delphi 8 (.NET only)

with AxLabel1 do
begin
	WordWrap := True;
	Caption := '<font ;32><sha ;;0><out><gra FFFFFF>gradient-bottom</gra><br><fgcolor=FFFFFF><gra 000000>gradien' + 
	't-top</gra></fgcolor><br><fgcolor=000000><gra F0F0F0;1;1>center-gradient</gra></fgcolor><br><sha' + 
	'><out><gra FFFFFF>gradient-bottom</gra><br><fgcolor=FFFFFF><gra 000000>gradient-top</gra></fgcol' + 
	'or><br><fgcolor=000000><gra F0F0F0;1;1>center-gradient</gra></fgcolor><br>';
end

Delphi (standard)

with Label1 do
begin
	WordWrap := True;
	Caption := '<font ;32><sha ;;0><out><gra FFFFFF>gradient-bottom</gra><br><fgcolor=FFFFFF><gra 000000>gradien' + 
	't-top</gra></fgcolor><br><fgcolor=000000><gra F0F0F0;1;1>center-gradient</gra></fgcolor><br><sha' + 
	'><out><gra FFFFFF>gradient-bottom</gra><br><fgcolor=FFFFFF><gra 000000>gradient-top</gra></fgcol' + 
	'or><br><fgcolor=000000><gra F0F0F0;1;1>center-gradient</gra></fgcolor><br>';
end

VFP

with thisform.Label1
	.WordWrap = .T.
	var_s = "<font ;32><sha ;;0><out><gra FFFFFF>gradient-bottom</gra><br><fgcolor=FFFFFF><gra 000000>gradien"
	var_s = var_s + "t-top</gra></fgcolor><br><fgcolor=000000><gra F0F0F0;1;1>center-gradient</gra></fgcolor><br><sha"
	var_s = var_s + "><out><gra FFFFFF>gradient-bottom</gra><br><fgcolor=FFFFFF><gra 000000>gradient-top</gra></fgcol"
	var_s = var_s + "or><br><fgcolor=000000><gra F0F0F0;1;1>center-gradient</gra></fgcolor><br>"
	.Caption = var_s
endwith

dBASE Plus

local oLabel

oLabel = form.Activex1.nativeObject
oLabel.WordWrap = true
oLabel.Caption = "<font ;32><sha ;;0><out><gra FFFFFF>gradient-bottom</gra><br><fgcolor=FFFFFF><gra 000000>gradient-top</gra></fgcolor><br><fgcolor=000000><gra F0F0F0;1;1>center-gradient</gra></fgcolor><br><sha><out><gra FFFFFF>gradient-bottom</gra><br><fgcolor=FFFFFF><gra 000000>gradient-top</gra></fgcolor><br><fgcolor=000000><gra F0F0F0;1;1>center-gradient</gra></fgcolor><br>"

XBasic (Alpha Five)

Dim oLabel as P

oLabel = topparent:CONTROL_ACTIVEX1.activex
oLabel.WordWrap = .t.
oLabel.Caption = "<font ;32><sha ;;0><out><gra FFFFFF>gradient-bottom</gra><br><fgcolor=FFFFFF><gra 000000>gradient-top</gra></fgcolor><br><fgcolor=000000><gra F0F0F0;1;1>center-gradient</gra></fgcolor><br><sha><out><gra FFFFFF>gradient-bottom</gra><br><fgcolor=FFFFFF><gra 000000>gradient-top</gra></fgcolor><br><fgcolor=000000><gra F0F0F0;1;1>center-gradient</gra></fgcolor><br>"

Visual Objects


oDCOCX_Exontrol1:WordWrap := true
oDCOCX_Exontrol1:Caption := "<font ;32><sha ;;0><out><gra FFFFFF>gradient-bottom</gra><br><fgcolor=FFFFFF><gra 000000>gradient-top</gra></fgcolor><br><fgcolor=000000><gra F0F0F0;1;1>center-gradient</gra></fgcolor><br><sha><out><gra FFFFFF>gradient-bottom</gra><br><fgcolor=FFFFFF><gra 000000>gradient-top</gra></fgcolor><br><fgcolor=000000><gra F0F0F0;1;1>center-gradient</gra></fgcolor><br>"

PowerBuilder

OleObject oLabel

oLabel = ole_1.Object
oLabel.WordWrap = true
oLabel.Caption = "<font ;32><sha ;;0><out><gra FFFFFF>gradient-bottom</gra><br><fgcolor=FFFFFF><gra 000000>gradient-top</gra></fgcolor><br><fgcolor=000000><gra F0F0F0;1;1>center-gradient</gra></fgcolor><br><sha><out><gra FFFFFF>gradient-bottom</gra><br><fgcolor=FFFFFF><gra 000000>gradient-top</gra></fgcolor><br><fgcolor=000000><gra F0F0F0;1;1>center-gradient</gra></fgcolor><br>"

Visual DataFlex

Procedure OnCreate
	Forward Send OnCreate
	Set ComWordWrap to True
	Set ComCaption to "<font ;32><sha ;;0><out><gra FFFFFF>gradient-bottom</gra><br><fgcolor=FFFFFF><gra 000000>gradient-top</gra></fgcolor><br><fgcolor=000000><gra F0F0F0;1;1>center-gradient</gra></fgcolor><br><sha><out><gra FFFFFF>gradient-bottom</gra><br><fgcolor=FFFFFF><gra 000000>gradient-top</gra></fgcolor><br><fgcolor=000000><gra F0F0F0;1;1>center-gradient</gra></fgcolor><br>"
End_Procedure

XBase++

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

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

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

	oLabel := XbpActiveXControl():new( oForm:drawingArea )
	oLabel:CLSID  := "Exontrol.Label.1" /*{09ABB057-BBDE-49A6-B5CB-B05197CD337B}*/
	oLabel:create(,, {10,60},{610,370} )

		oLabel:WordWrap := .T.
		oLabel:Caption := "<font ;32><sha ;;0><out><gra FFFFFF>gradient-bottom</gra><br><fgcolor=FFFFFF><gra 000000>gradient-top</gra></fgcolor><br><fgcolor=000000><gra F0F0F0;1;1>center-gradient</gra></fgcolor><br><sha><out><gra FFFFFF>gradient-bottom</gra><br><fgcolor=FFFFFF><gra 000000>gradient-top</gra></fgcolor><br><fgcolor=000000><gra F0F0F0;1;1>center-gradient</gra></fgcolor><br>"

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