event CheckItem (Itm as Item)
Occurs when the user checks the item.

TypeDescription
Itm as Item An Item object that indicates the item being checked.

The trial/evaluation version of the control limits firing this event. In other words, using the trial/evaluation version won't fire the event every time.

The CheckItem event notifies your application once the user clicks the item's check-box. The Check property indicates whether the Item has associated a check box. The Checked property specifies whether the item is checked or unchecked. Use the Radio property to display a radio-button on the item. In C++ or VFP, you can use the Notifier to get notified through the WM_COMMAND message. The Checked property specifies whether the item is checked or unchecked. The UncheckedItem event notifies once the user un-checks the item.

Syntax for CheckItem event, /NET version, on:

private void CheckItem(object sender,exontrol.EXTOOLBARLib.Item Itm)
{
}

Private Sub CheckItem(ByVal sender As System.Object,ByVal Itm As exontrol.EXTOOLBARLib.Item) Handles CheckItem
End Sub

Syntax for CheckItem event, /COM version, on:

private void CheckItem(object sender, AxEXTOOLBARLib._IToolBarEvents_CheckItemEvent e)
{
}

void OnCheckItem(LPDISPATCH Itm)
{
}

void __fastcall CheckItem(TObject *Sender,Extoolbarlib_tlb::IItem *Itm)
{
}

procedure CheckItem(ASender: TObject; Itm : IItem);
begin
end;

procedure CheckItem(sender: System.Object; e: AxEXTOOLBARLib._IToolBarEvents_CheckItemEvent);
begin
end;

begin event CheckItem(oleobject Itm)
end event CheckItem

Private Sub CheckItem(ByVal sender As System.Object, ByVal e As AxEXTOOLBARLib._IToolBarEvents_CheckItemEvent) Handles CheckItem
End Sub

Private Sub CheckItem(ByVal Itm As EXTOOLBARLibCtl.IItem)
End Sub

Private Sub CheckItem(ByVal Itm As Object)
End Sub

LPARAMETERS Itm

PROCEDURE OnCheckItem(oToolBar,Itm)
RETURN

Syntax for CheckItem event, /COM version (others), on:

<SCRIPT EVENT="CheckItem(Itm)" LANGUAGE="JScript">
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Function CheckItem(Itm)
End Function
</SCRIPT>

Procedure OnComCheckItem Variant llItm
	Forward Send OnComCheckItem llItm
End_Procedure

METHOD OCX_CheckItem(Itm) CLASS MainDialog
RETURN NIL

void onEvent_CheckItem(COM _Itm)
{
}

function CheckItem as v (Itm as OLE::Exontrol.ToolBar.1::IItem)
end function

function nativeObject_CheckItem(Itm)
return

The following samples show how you can get notified once the user checks an item:

VBA (MS Access, Excell...)

' CheckItem event - Occurs when the user checks the item.
Private Sub ToolBar1_CheckItem(ByVal Itm As Object)
	With ToolBar1
		Debug.Print( "CheckItem event on Itm object" )
	End With
End Sub

With ToolBar1
	With .Items
		.Add("Item").Check = True
		.Add("Item").Check = True
	End With
	.Refresh 
End With

VB6

' CheckItem event - Occurs when the user checks the item.
Private Sub ToolBar1_CheckItem(ByVal Itm As EXTOOLBARLibCtl.IItem)
	With ToolBar1
		Debug.Print( "CheckItem event on Itm object" )
	End With
End Sub

With ToolBar1
	With .Items
		.Add("Item").Check = True
		.Add("Item").Check = True
	End With
	.Refresh 
End With

VB.NET

' CheckItem event - Occurs when the user checks the item.
Private Sub Extoolbar1_CheckItem(ByVal sender As System.Object,ByVal Itm As exontrol.EXTOOLBARLib.Item) Handles Extoolbar1.CheckItem
	With Extoolbar1
		Debug.Print( "CheckItem event on Itm object" )
	End With
End Sub

With Extoolbar1
	With .Items
		.Add("Item").Check = True
		.Add("Item").Check = True
	End With
	.Refresh()
End With

VB.NET for /COM

' CheckItem event - Occurs when the user checks the item.
Private Sub AxToolBar1_CheckItem(ByVal sender As System.Object, ByVal e As AxEXTOOLBARLib._IToolBarEvents_CheckItemEvent) Handles AxToolBar1.CheckItem
	With AxToolBar1
		Debug.Print( "CheckItem event on Itm object" )
	End With
End Sub

With AxToolBar1
	With .Items
		.Add("Item").Check = True
		.Add("Item").Check = True
	End With
	.Refresh()
End With

C++

// CheckItem event - Occurs when the user checks the item.
void OnCheckItemToolBar1(LPDISPATCH Itm)
{
	/*
		Copy and paste the following directives to your header file as
		it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'
		#import <ExToolBar.dll>
		using namespace EXTOOLBARLib;
	*/
	EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
	OutputDebugStringW( L"CheckItem event on Itm object" );
}

EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
	var_Items->Add(L"Item",vtMissing,vtMissing)->PutCheck(VARIANT_TRUE);
	var_Items->Add(L"Item",vtMissing,vtMissing)->PutCheck(VARIANT_TRUE);
spToolBar1->Refresh();

C++ Builder

// CheckItem event - Occurs when the user checks the item.
void __fastcall TForm1::ToolBar1CheckItem(TObject *Sender,Extoolbarlib_tlb::IItem *Itm)
{
	OutputDebugString( L"CheckItem event on Itm object" );
}

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
	var_Items->Add(L"Item",TNoParam(),TNoParam())->Check = true;
	var_Items->Add(L"Item",TNoParam(),TNoParam())->Check = true;
ToolBar1->Refresh();

C#

// CheckItem event - Occurs when the user checks the item.
private void extoolbar1_CheckItem(object sender,exontrol.EXTOOLBARLib.Item Itm)
{
	System.Diagnostics.Debug.Print( "CheckItem event on Itm object" );
}
//this.extoolbar1.CheckItem += new exontrol.EXTOOLBARLib.exg2antt.CheckItemEventHandler(this.extoolbar1_CheckItem);

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
	var_Items.Add("Item",null,null).Check = true;
	var_Items.Add("Item",null,null).Check = true;
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<SCRIPT FOR="ToolBar1" EVENT="CheckItem(Itm)" LANGUAGE="JScript">
	alert( "CheckItem event on Itm object" );
</SCRIPT>

<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
	var var_Items = ToolBar1.Items;
		var_Items.Add("Item",null,null).Check = true;
		var_Items.Add("Item",null,null).Check = true;
	ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<SCRIPT LANGUAGE="VBScript">
Function ToolBar1_CheckItem(Itm)
	With ToolBar1
		alert( "CheckItem event on Itm object" )
	End With
End Function
</SCRIPT>

<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
	With ToolBar1
		With .Items
			.Add("Item").Check = True
			.Add("Item").Check = True
		End With
		.Refresh 
	End With
End Function
</SCRIPT>
</BODY>

C# for /COM

// CheckItem event - Occurs when the user checks the item.
private void axToolBar1_CheckItem(object sender, AxEXTOOLBARLib._IToolBarEvents_CheckItemEvent e)
{
	System.Diagnostics.Debug.Print( "CheckItem event on Itm object" );
}
//this.axToolBar1.CheckItem += new AxEXTOOLBARLib._IToolBarEvents_CheckItemEventHandler(this.axToolBar1_CheckItem);

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
	var_Items.Add("Item",null,null).Check = true;
	var_Items.Add("Item",null,null).Check = true;
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

// CheckItem event - Occurs when the user checks the item.
void onEvent_CheckItem(COM _Itm)
{
	;
	print( "CheckItem event on Itm object" );
}

public void init()
{
	COM com_Item,com_Items;
	anytype var_Item,var_Items;
	;

	super();

	var_Items = extoolbar1.Items(); com_Items = var_Items;
		var_Item = COM::createFromObject(com_Items.Add("Item")); com_Item = var_Item;
		com_Item.Check(true);
		var_Item = COM::createFromObject(com_Items.Add("Item")); com_Item = var_Item;
		com_Item.Check(true);
	extoolbar1.Refresh();
}

Delphi 8 (.NET only)

// CheckItem event - Occurs when the user checks the item.
procedure TWinForm1.AxToolBar1_CheckItem(sender: System.Object; e: AxEXTOOLBARLib._IToolBarEvents_CheckItemEvent);
begin
	with AxToolBar1 do
	begin
		OutputDebugString( 'CheckItem event on Itm object' );
	end
end;

with AxToolBar1 do
begin
	with Items do
	begin
		Add('Item',Nil,Nil).Check := True;
		Add('Item',Nil,Nil).Check := True;
	end;
	Refresh();
end

Delphi (standard)

// CheckItem event - Occurs when the user checks the item.
procedure TForm1.ToolBar1CheckItem(ASender: TObject; Itm : IItem);
begin
	with ToolBar1 do
	begin
		OutputDebugString( 'CheckItem event on Itm object' );
	end
end;

with ToolBar1 do
begin
	with Items do
	begin
		Add('Item',Null,Null).Check := True;
		Add('Item',Null,Null).Check := True;
	end;
	Refresh();
end

VFP

*** CheckItem event - Occurs when the user checks the item. ***
LPARAMETERS Itm
	with thisform.ToolBar1
		DEBUGOUT( "CheckItem event on Itm object" )
	endwith

with thisform.ToolBar1
	with .Items
		.Add("Item").Check = .T.
		.Add("Item").Check = .T.
	endwith
	.Refresh
endwith

dBASE Plus

/*
with (this.ACTIVEX1.nativeObject)
	CheckItem = class::nativeObject_CheckItem
endwith
*/
// Occurs when the user checks the item.
function nativeObject_CheckItem(Itm)
	local oToolBar
	oToolBar = form.Activex1.nativeObject
	? "CheckItem event on Itm object" 
return

local oToolBar,var_Item,var_Item1,var_Items

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
	// var_Items.Add("Item").Check = true
	var_Item = var_Items.Add("Item")
	with (oToolBar)
		TemplateDef = [Dim var_Item]
		TemplateDef = var_Item
		Template = [var_Item.Check = true]
	endwith
	// var_Items.Add("Item").Check = true
	var_Item1 = var_Items.Add("Item")
	with (oToolBar)
		TemplateDef = [Dim var_Item1]
		TemplateDef = var_Item1
		Template = [var_Item1.Check = true]
	endwith
oToolBar.Refresh()

XBasic (Alpha Five)

' Occurs when the user checks the item.
function CheckItem as v (Itm as OLE::Exontrol.ToolBar.1::IItem)
	Dim oToolBar as P
	oToolBar = topparent:CONTROL_ACTIVEX1.activex
	? "CheckItem event on Itm object" 
end function

Dim oToolBar as P
Dim var_Item as P
Dim var_Item1 as P
Dim var_Items as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
	' var_Items.Add("Item").Check = .t.
	var_Item = var_Items.Add("Item")
	oToolBar.TemplateDef = "Dim var_Item"
	oToolBar.TemplateDef = var_Item
	oToolBar.Template = "var_Item.Check = True"

	' var_Items.Add("Item").Check = .t.
	var_Item1 = var_Items.Add("Item")
	oToolBar.TemplateDef = "Dim var_Item1"
	oToolBar.TemplateDef = var_Item1
	oToolBar.Template = "var_Item1.Check = True"

oToolBar.Refresh()

Visual Objects

METHOD OCX_Exontrol1CheckItem(Itm) CLASS MainDialog
	// CheckItem event - Occurs when the user checks the item.
	OutputDebugString(String2Psz( "CheckItem event on Itm object" ))
RETURN NIL

local var_Items as IItems

var_Items := oDCOCX_Exontrol1:Items
	var_Items:Add("Item",nil,nil):Check := true
	var_Items:Add("Item",nil,nil):Check := true
oDCOCX_Exontrol1:Refresh()

PowerBuilder

/*begin event CheckItem(oleobject Itm) - Occurs when the user checks the item.*/
/*
	OleObject oToolBar
	oToolBar = ole_1.Object
	MessageBox("Information",string( "CheckItem event on Itm object" ))
*/
/*end event CheckItem*/

OleObject oToolBar,var_Items

oToolBar = ole_1.Object
var_Items = oToolBar.Items
	var_Items.Add("Item").Check = true
	var_Items.Add("Item").Check = true
oToolBar.Refresh()

Visual DataFlex

// Occurs when the user checks the item.
Procedure OnComCheckItem Variant llItm
	Forward Send OnComCheckItem llItm
	Showln "CheckItem event on Itm object"
End_Procedure

Procedure OnCreate
	Forward Send OnCreate
	Variant voItems
	Get ComItems to voItems
	Handle hoItems
	Get Create (RefClass(cComItems)) to hoItems
	Set pvComObject of hoItems to voItems
		Variant voItem
		Get ComAdd of hoItems "Item" Nothing Nothing to voItem
		Handle hoItem
		Get Create (RefClass(cComItem)) to hoItem
		Set pvComObject of hoItem to voItem
			Set ComCheck of hoItem to True
		Send Destroy to hoItem
		Variant voItem1
		Get ComAdd of hoItems "Item" Nothing Nothing to voItem1
		Handle hoItem1
		Get Create (RefClass(cComItem)) to hoItem1
		Set pvComObject of hoItem1 to voItem1
			Set ComCheck of hoItem1 to True
		Send Destroy to hoItem1
	Send Destroy to hoItems
	Send ComRefresh
End_Procedure

XBase++

PROCEDURE OnCheckItem(oToolBar,Itm)
	DevOut( "CheckItem event on Itm object" )
RETURN

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

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

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

	oToolBar := XbpActiveXControl():new( oForm:drawingArea )
	oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
	oToolBar:create(,, {10,60},{610,370} )

		oToolBar:CheckItem := {|Itm| OnCheckItem(oToolBar,Itm)} /*Occurs when the user checks the item.*/

		oItems := oToolBar:Items()
			oItems:Add("Item"):Check := .T.
			oItems:Add("Item"):Check := .T.
		oToolBar:Refresh()

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