Type | Description | |||
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.EXRIBBONLib.Item Itm) { } Private Sub CheckItem(ByVal sender As System.Object,ByVal Itm As exontrol.EXRIBBONLib.Item) Handles CheckItem End Sub |
private void CheckItem(object sender, AxEXRIBBONLib._IRibbonEvents_CheckItemEvent e) { } void OnCheckItem(LPDISPATCH Itm) { } void __fastcall CheckItem(TObject *Sender,Exribbonlib_tlb::IItem *Itm) { } procedure CheckItem(ASender: TObject; Itm : IItem); begin end; procedure CheckItem(sender: System.Object; e: AxEXRIBBONLib._IRibbonEvents_CheckItemEvent); begin end; begin event CheckItem(oleobject Itm) end event CheckItem Private Sub CheckItem(ByVal sender As System.Object, ByVal e As AxEXRIBBONLib._IRibbonEvents_CheckItemEvent) Handles CheckItem End Sub Private Sub CheckItem(ByVal Itm As EXRIBBONLibCtl.IItem) End Sub Private Sub CheckItem(ByVal Itm As Object) End Sub LPARAMETERS Itm PROCEDURE OnCheckItem(oRibbon,Itm) RETURN |
<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.Ribbon.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 Ribbon1_CheckItem(ByVal Itm As Object) With Ribbon1 Debug.Print( "CheckItem event on Itm object" ) End With End Sub With Ribbon1 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 Ribbon1_CheckItem(ByVal Itm As EXRIBBONLibCtl.IItem) With Ribbon1 Debug.Print( "CheckItem event on Itm object" ) End With End Sub With Ribbon1 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 Exribbon1_CheckItem(ByVal sender As System.Object,ByVal Itm As exontrol.EXRIBBONLib.Item) Handles Exribbon1.CheckItem With Exribbon1 Debug.Print( "CheckItem event on Itm object" ) End With End Sub With Exribbon1 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 AxRibbon1_CheckItem(ByVal sender As System.Object, ByVal e As AxEXRIBBONLib._IRibbonEvents_CheckItemEvent) Handles AxRibbon1.CheckItem With AxRibbon1 Debug.Print( "CheckItem event on Itm object" ) End With End Sub With AxRibbon1 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 OnCheckItemRibbon1(LPDISPATCH Itm) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXRIBBONLib' for the library: 'ExRibbon 1.0 Control Library' #import <ExRibbon.dll> using namespace EXRIBBONLib; */ EXRIBBONLib::IRibbonPtr spRibbon1 = GetDlgItem(IDC_RIBBON1)->GetControlUnknown(); OutputDebugStringW( L"CheckItem event on Itm object" ); } EXRIBBONLib::IRibbonPtr spRibbon1 = GetDlgItem(IDC_RIBBON1)->GetControlUnknown(); EXRIBBONLib::IItemsPtr var_Items = spRibbon1->GetItems(); var_Items->Add(L"Item",vtMissing,vtMissing)->PutCheck(VARIANT_TRUE); var_Items->Add(L"Item",vtMissing,vtMissing)->PutCheck(VARIANT_TRUE); spRibbon1->Refresh();
C++ Builder
// CheckItem event - Occurs when the user checks the item. void __fastcall TForm1::Ribbon1CheckItem(TObject *Sender,Exribbonlib_tlb::IItem *Itm) { OutputDebugString( L"CheckItem event on Itm object" ); } Exribbonlib_tlb::IItemsPtr var_Items = Ribbon1->Items; var_Items->Add(L"Item",TNoParam(),TNoParam())->Check = true; var_Items->Add(L"Item",TNoParam(),TNoParam())->Check = true; Ribbon1->Refresh();
C#
// CheckItem event - Occurs when the user checks the item. private void exribbon1_CheckItem(object sender,exontrol.EXRIBBONLib.Item Itm) { System.Diagnostics.Debug.Print( "CheckItem event on Itm object" ); } //this.exribbon1.CheckItem += new exontrol.EXRIBBONLib.exg2antt.CheckItemEventHandler(this.exribbon1_CheckItem); exontrol.EXRIBBONLib.Items var_Items = exribbon1.Items; var_Items.Add("Item",null,null).Check = true; var_Items.Add("Item",null,null).Check = true; exribbon1.Refresh();
JScript/JavaScript
<BODY onload='Init()'> <SCRIPT FOR="Ribbon1" EVENT="CheckItem(Itm)" LANGUAGE="JScript"> alert( "CheckItem event on Itm object" ); </SCRIPT> <OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="Ribbon1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { var var_Items = Ribbon1.Items; var_Items.Add("Item",null,null).Check = true; var_Items.Add("Item",null,null).Check = true; Ribbon1.Refresh(); } </SCRIPT> </BODY>
VBScript
<BODY onload='Init()'> <SCRIPT LANGUAGE="VBScript"> Function Ribbon1_CheckItem(Itm) With Ribbon1 alert( "CheckItem event on Itm object" ) End With End Function </SCRIPT> <OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="Ribbon1"></OBJECT> <SCRIPT LANGUAGE="VBScript"> Function Init() With Ribbon1 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 axRibbon1_CheckItem(object sender, AxEXRIBBONLib._IRibbonEvents_CheckItemEvent e) { System.Diagnostics.Debug.Print( "CheckItem event on Itm object" ); } //this.axRibbon1.CheckItem += new AxEXRIBBONLib._IRibbonEvents_CheckItemEventHandler(this.axRibbon1_CheckItem); EXRIBBONLib.Items var_Items = axRibbon1.Items; var_Items.Add("Item",null,null).Check = true; var_Items.Add("Item",null,null).Check = true; axRibbon1.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 = exribbon1.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); exribbon1.Refresh(); }
Delphi 8 (.NET only)
// CheckItem event - Occurs when the user checks the item. procedure TWinForm1.AxRibbon1_CheckItem(sender: System.Object; e: AxEXRIBBONLib._IRibbonEvents_CheckItemEvent); begin with AxRibbon1 do begin OutputDebugString( 'CheckItem event on Itm object' ); end end; with AxRibbon1 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.Ribbon1CheckItem(ASender: TObject; Itm : IItem); begin with Ribbon1 do begin OutputDebugString( 'CheckItem event on Itm object' ); end end; with Ribbon1 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.Ribbon1 DEBUGOUT( "CheckItem event on Itm object" ) endwith with thisform.Ribbon1 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 oRibbon oRibbon = form.Activex1.nativeObject ? "CheckItem event on Itm object" return local oRibbon,var_Item,var_Item1,var_Items oRibbon = form.Activex1.nativeObject var_Items = oRibbon.Items // var_Items.Add("Item").Check = true var_Item = var_Items.Add("Item") with (oRibbon) 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 (oRibbon) TemplateDef = [Dim var_Item1] TemplateDef = var_Item1 Template = [var_Item1.Check = true] endwith oRibbon.Refresh()
XBasic (Alpha Five)
' Occurs when the user checks the item. function CheckItem as v (Itm as OLE::Exontrol.Ribbon.1::IItem) Dim oRibbon as P oRibbon = topparent:CONTROL_ACTIVEX1.activex ? "CheckItem event on Itm object" end function Dim oRibbon as P Dim var_Item as P Dim var_Item1 as P Dim var_Items as P oRibbon = topparent:CONTROL_ACTIVEX1.activex var_Items = oRibbon.Items ' var_Items.Add("Item").Check = .t. var_Item = var_Items.Add("Item") oRibbon.TemplateDef = "Dim var_Item" oRibbon.TemplateDef = var_Item oRibbon.Template = "var_Item.Check = True" ' var_Items.Add("Item").Check = .t. var_Item1 = var_Items.Add("Item") oRibbon.TemplateDef = "Dim var_Item1" oRibbon.TemplateDef = var_Item1 oRibbon.Template = "var_Item1.Check = True" oRibbon.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 oRibbon oRibbon = ole_1.Object MessageBox("Information",string( "CheckItem event on Itm object" )) */ /*end event CheckItem*/ OleObject oRibbon,var_Items oRibbon = ole_1.Object var_Items = oRibbon.Items var_Items.Add("Item").Check = true var_Items.Add("Item").Check = true oRibbon.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(oRibbon,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 oRibbon oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oRibbon := XbpActiveXControl():new( oForm:drawingArea ) oRibbon:CLSID := "Exontrol.Ribbon.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/ oRibbon:create(,, {10,60},{610,370} ) oRibbon:CheckItem := {|Itm| OnCheckItem(oRibbon,Itm)} /*Occurs when the user checks the item.*/ oItems := oRibbon:Items() oItems:Add("Item"):Check := .T. oItems:Add("Item"):Check := .T. oRibbon:Refresh() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN