exlistbar - sample code

Does your control support subscript or superscript, in HTML captions?

VBA (MS Access, Excell...)

With ListBar1
	With .Groups.Add("Group")
		.AddItem("Item <b><off 4><font ;6>1").CaptionFormat = 1
		.AddItem("Item <b><off 4><font ;6>2").CaptionFormat = 1
	End With
End With

VB6

With ListBar1
	With .Groups.Add("Group")
		.AddItem("Item <b><off 4><font ;6>1").CaptionFormat = exHTML
		.AddItem("Item <b><off 4><font ;6>2").CaptionFormat = exHTML
	End With
End With

VB.NET

With Exlistbar1
	With .Groups.Add("Group")
		.AddItem("Item <b><off 4><font ;6>1").CaptionFormat = exontrol.EXLISTBARLib.CaptionFormatEnum.exHTML
		.AddItem("Item <b><off 4><font ;6>2").CaptionFormat = exontrol.EXLISTBARLib.CaptionFormatEnum.exHTML
	End With
End With

VB.NET for /COM

With AxListBar1
	With .Groups.Add("Group")
		.AddItem("Item <b><off 4><font ;6>1").CaptionFormat = EXLISTBARLib.CaptionFormatEnum.exHTML
		.AddItem("Item <b><off 4><font ;6>2").CaptionFormat = EXLISTBARLib.CaptionFormatEnum.exHTML
	End With
End With

C++

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

	#import <ExListBar.dll>
	using namespace EXLISTBARLib;
*/
EXLISTBARLib::IListBarPtr spListBar1 = GetDlgItem(IDC_LISTBAR1)->GetControlUnknown();
EXLISTBARLib::IGroupPtr var_Group = spListBar1->GetGroups()->Add(L"Group");
	var_Group->AddItem(L"Item <b><off 4><font ;6>1",vtMissing)->PutCaptionFormat(EXLISTBARLib::exHTML);
	var_Group->AddItem(L"Item <b><off 4><font ;6>2",vtMissing)->PutCaptionFormat(EXLISTBARLib::exHTML);

C++ Builder

Exlistbarlib_tlb::IGroupPtr var_Group = ListBar1->Groups->Add(L"Group");
	var_Group->AddItem(L"Item <b><off 4><font ;6>1",TNoParam())->CaptionFormat = Exlistbarlib_tlb::CaptionFormatEnum::exHTML;
	var_Group->AddItem(L"Item <b><off 4><font ;6>2",TNoParam())->CaptionFormat = Exlistbarlib_tlb::CaptionFormatEnum::exHTML;

C#

exontrol.EXLISTBARLib.Group var_Group = exlistbar1.Groups.Add("Group");
	var_Group.AddItem("Item <b><off 4><font ;6>1",null).CaptionFormat = exontrol.EXLISTBARLib.CaptionFormatEnum.exHTML;
	var_Group.AddItem("Item <b><off 4><font ;6>2",null).CaptionFormat = exontrol.EXLISTBARLib.CaptionFormatEnum.exHTML;

JavaScript

<OBJECT classid="clsid:41387A8B-6293-46CE-B9D8-55F49AE0DA60" id="ListBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
	var var_Group = ListBar1.Groups.Add("Group");
		var_Group.AddItem("Item <b><off 4><font ;6>1",null).CaptionFormat = 1;
		var_Group.AddItem("Item <b><off 4><font ;6>2",null).CaptionFormat = 1;
</SCRIPT>

C# for /COM

EXLISTBARLib.Group var_Group = axListBar1.Groups.Add("Group");
	var_Group.AddItem("Item <b><off 4><font ;6>1",null).CaptionFormat = EXLISTBARLib.CaptionFormatEnum.exHTML;
	var_Group.AddItem("Item <b><off 4><font ;6>2",null).CaptionFormat = EXLISTBARLib.CaptionFormatEnum.exHTML;

X++ (Dynamics Ax 2009)

public void init()
{
	COM com_Group,com_Item;
	anytype var_Group,var_Item;
	;

	super();

	var_Group = COM::createFromObject(exlistbar1.Groups()).Add("Group"); com_Group = var_Group;
		var_Item = COM::createFromObject(com_Group.AddItem("Item <b><off 4><font ;6>1")); com_Item = var_Item;
		com_Item.CaptionFormat(1/*exHTML*/);
		var_Item = COM::createFromObject(com_Group.AddItem("Item <b><off 4><font ;6>2")); com_Item = var_Item;
		com_Item.CaptionFormat(1/*exHTML*/);
}

Delphi 8 (.NET only)

with AxListBar1 do
begin
	with Groups.Add('Group') do
	begin
		AddItem('Item <b><off 4><font ;6>1',Nil).CaptionFormat := EXLISTBARLib.CaptionFormatEnum.exHTML;
		AddItem('Item <b><off 4><font ;6>2',Nil).CaptionFormat := EXLISTBARLib.CaptionFormatEnum.exHTML;
	end;
end

Delphi (standard)

with ListBar1 do
begin
	with Groups.Add('Group') do
	begin
		AddItem('Item <b><off 4><font ;6>1',Null).CaptionFormat := EXLISTBARLib_TLB.exHTML;
		AddItem('Item <b><off 4><font ;6>2',Null).CaptionFormat := EXLISTBARLib_TLB.exHTML;
	end;
end

VFP

with thisform.ListBar1
	with .Groups.Add("Group")
		.AddItem("Item <b><off 4><font ;6>1").CaptionFormat = 1
		.AddItem("Item <b><off 4><font ;6>2").CaptionFormat = 1
	endwith
endwith

dBASE Plus

local oListBar,var_Group,var_Item,var_Item1

oListBar = form.Activex1.nativeObject
var_Group = oListBar.Groups.Add("Group")
	// var_Group.AddItem("Item <b><off 4><font ;6>1").CaptionFormat = 1
	var_Item = var_Group.AddItem("Item <b><off 4><font ;6>1")
	with (oListBar)
		TemplateDef = [Dim var_Item]
		TemplateDef = var_Item
		Template = [var_Item.CaptionFormat = 1]
	endwith
	// var_Group.AddItem("Item <b><off 4><font ;6>2").CaptionFormat = 1
	var_Item1 = var_Group.AddItem("Item <b><off 4><font ;6>2")
	with (oListBar)
		TemplateDef = [Dim var_Item1]
		TemplateDef = var_Item1
		Template = [var_Item1.CaptionFormat = 1]
	endwith

XBasic (Alpha Five)

Dim oListBar as P
Dim var_Group as P
Dim var_Item as P
Dim var_Item1 as P

oListBar = topparent:CONTROL_ACTIVEX1.activex
var_Group = oListBar.Groups.Add("Group")
	' var_Group.AddItem("Item <b><off 4><font ;6>1").CaptionFormat = 1
	var_Item = var_Group.AddItem("Item <b><off 4><font ;6>1")
	oListBar.TemplateDef = "Dim var_Item"
	oListBar.TemplateDef = var_Item
	oListBar.Template = "var_Item.CaptionFormat = 1"

	' var_Group.AddItem("Item <b><off 4><font ;6>2").CaptionFormat = 1
	var_Item1 = var_Group.AddItem("Item <b><off 4><font ;6>2")
	oListBar.TemplateDef = "Dim var_Item1"
	oListBar.TemplateDef = var_Item1
	oListBar.Template = "var_Item1.CaptionFormat = 1"


Visual Objects

local var_Group as IGroup

var_Group := oDCOCX_Exontrol1:Groups:Add("Group")
	var_Group:AddItem("Item <b><off 4><font ;6>1",nil):CaptionFormat := exHTML
	var_Group:AddItem("Item <b><off 4><font ;6>2",nil):CaptionFormat := exHTML

PowerBuilder

OleObject oListBar,var_Group

oListBar = ole_1.Object
var_Group = oListBar.Groups.Add("Group")
	var_Group.AddItem("Item <b><off 4><font ;6>1").CaptionFormat = 1
	var_Group.AddItem("Item <b><off 4><font ;6>2").CaptionFormat = 1

Visual DataFlex

Procedure OnCreate
	Forward Send OnCreate
	Variant voGroups
	Get ComGroups to voGroups
	Handle hoGroups
	Get Create (RefClass(cComGroups)) to hoGroups
	Set pvComObject of hoGroups to voGroups
		Variant voGroup
		Get ComAdd of hoGroups "Group" to voGroup
		Handle hoGroup
		Get Create (RefClass(cComGroup)) to hoGroup
		Set pvComObject of hoGroup to voGroup
			Variant voItem
			Get ComAddItem of hoGroup "Item <b><off 4><font ;6>1" Nothing to voItem
			Handle hoItem
			Get Create (RefClass(cComItem)) to hoItem
			Set pvComObject of hoItem to voItem
				Set ComCaptionFormat of hoItem to OLEexHTML
			Send Destroy to hoItem
			Variant voItem1
			Get ComAddItem of hoGroup "Item <b><off 4><font ;6>2" Nothing to voItem1
			Handle hoItem1
			Get Create (RefClass(cComItem)) to hoItem1
			Set pvComObject of hoItem1 to voItem1
				Set ComCaptionFormat of hoItem1 to OLEexHTML
			Send Destroy to hoItem1
		Send Destroy to hoGroup
	Send Destroy to hoGroups
End_Procedure

XBase++

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

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

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

	oListBar := XbpActiveXControl():new( oForm:drawingArea )
	oListBar:CLSID  := "Exontrol.ListBar.1" /*{41387A8B-6293-46CE-B9D8-55F49AE0DA60}*/
	oListBar:create(,, {10,60},{610,370} )

		oGroup := oListBar:Groups():Add("Group")
			oGroup:AddItem("Item <b><off 4><font ;6>1"):CaptionFormat := 1/*exHTML*/
			oGroup:AddItem("Item <b><off 4><font ;6>2"):CaptionFormat := 1/*exHTML*/

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
Copyright 1999-2017 Exontrol. All rights reserved.