Type | Description | |||
Itm as Item | An Item object being clicked. |
The SelectItem event notifies your application once the user clicks/selects an item. The ID property specifies the item's identifier. In C++ or VFP, you can use the Notifier to get notified through the WM_COMMAND message.
Syntax for SelectItem event, /NET version, on:
private void SelectItem(object sender,exontrol.EXTOOLBARLib.Item Itm) { } Private Sub SelectItem(ByVal sender As System.Object,ByVal Itm As exontrol.EXTOOLBARLib.Item) Handles SelectItem End Sub |
private void SelectItem(object sender, AxEXTOOLBARLib._IToolBarEvents_SelectItemEvent e) { } void OnSelectItem(LPDISPATCH Itm) { } void __fastcall SelectItem(TObject *Sender,Extoolbarlib_tlb::IItem *Itm) { } procedure SelectItem(ASender: TObject; Itm : IItem); begin end; procedure SelectItem(sender: System.Object; e: AxEXTOOLBARLib._IToolBarEvents_SelectItemEvent); begin end; begin event SelectItem(oleobject Itm) end event SelectItem Private Sub SelectItem(ByVal sender As System.Object, ByVal e As AxEXTOOLBARLib._IToolBarEvents_SelectItemEvent) Handles SelectItem End Sub Private Sub SelectItem(ByVal Itm As EXTOOLBARLibCtl.IItem) End Sub Private Sub SelectItem(ByVal Itm As Object) End Sub LPARAMETERS Itm PROCEDURE OnSelectItem(oToolBar,Itm) RETURN |
<SCRIPT EVENT="SelectItem(Itm)" LANGUAGE="JScript"> </SCRIPT> <SCRIPT LANGUAGE="VBScript"> Function SelectItem(Itm) End Function </SCRIPT> Procedure OnComSelectItem Variant llItm Forward Send OnComSelectItem llItm End_Procedure METHOD OCX_SelectItem(Itm) CLASS MainDialog RETURN NIL void onEvent_SelectItem(COM _Itm) { } function SelectItem as v (Itm as OLE::Exontrol.ToolBar.1::IItem) end function function nativeObject_SelectItem(Itm) return |
The following samples show how you can get notified once the user clicks the item:
VBA (MS Access, Excell...)
' SelectItem event - Occurs when the user selects the item. Private Sub ToolBar1_SelectItem(ByVal Itm As Object) With ToolBar1 Debug.Print( "SelectItem event on Itm object" ) End With End Sub With ToolBar1 With .Items .Add "Item" .Add "Item" End With .Refresh End With
VB6
' SelectItem event - Occurs when the user selects the item. Private Sub ToolBar1_SelectItem(ByVal Itm As EXTOOLBARLibCtl.IItem) With ToolBar1 Debug.Print( "SelectItem event on Itm object" ) End With End Sub With ToolBar1 With .Items .Add "Item" .Add "Item" End With .Refresh End With
VB.NET
' SelectItem event - Occurs when the user selects the item. Private Sub Extoolbar1_SelectItem(ByVal sender As System.Object,ByVal Itm As exontrol.EXTOOLBARLib.Item) Handles Extoolbar1.SelectItem With Extoolbar1 Debug.Print( "SelectItem event on Itm object" ) End With End Sub With Extoolbar1 With .Items .Add("Item") .Add("Item") End With .Refresh() End With
VB.NET for /COM
' SelectItem event - Occurs when the user selects the item. Private Sub AxToolBar1_SelectItem(ByVal sender As System.Object, ByVal e As AxEXTOOLBARLib._IToolBarEvents_SelectItemEvent) Handles AxToolBar1.SelectItem With AxToolBar1 Debug.Print( "SelectItem event on Itm object" ) End With End Sub With AxToolBar1 With .Items .Add("Item") .Add("Item") End With .Refresh() End With
C++
// SelectItem event - Occurs when the user selects the item. void OnSelectItemToolBar1(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"SelectItem event on Itm object" ); } EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown(); EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems(); var_Items->Add(L"Item",vtMissing,vtMissing); var_Items->Add(L"Item",vtMissing,vtMissing); spToolBar1->Refresh();
C++ Builder
// SelectItem event - Occurs when the user selects the item. void __fastcall TForm1::ToolBar1SelectItem(TObject *Sender,Extoolbarlib_tlb::IItem *Itm) { OutputDebugString( L"SelectItem event on Itm object" ); } Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items; var_Items->Add(L"Item",TNoParam(),TNoParam()); var_Items->Add(L"Item",TNoParam(),TNoParam()); ToolBar1->Refresh();
C#
// SelectItem event - Occurs when the user selects the item. private void extoolbar1_SelectItem(object sender,exontrol.EXTOOLBARLib.Item Itm) { System.Diagnostics.Debug.Print( "SelectItem event on Itm object" ); } //this.extoolbar1.SelectItem += new exontrol.EXTOOLBARLib.exg2antt.SelectItemEventHandler(this.extoolbar1_SelectItem); exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items; var_Items.Add("Item",null,null); var_Items.Add("Item",null,null); extoolbar1.Refresh();
JScript/JavaScript
<BODY onload='Init()'> <SCRIPT FOR="ToolBar1" EVENT="SelectItem(Itm)" LANGUAGE="JScript"> alert( "SelectItem 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); var_Items.Add("Item",null,null); ToolBar1.Refresh(); } </SCRIPT> </BODY>
VBScript
<BODY onload='Init()'> <SCRIPT LANGUAGE="VBScript"> Function ToolBar1_SelectItem(Itm) With ToolBar1 alert( "SelectItem 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" .Add "Item" End With .Refresh End With End Function </SCRIPT> </BODY>
C# for /COM
// SelectItem event - Occurs when the user selects the item. private void axToolBar1_SelectItem(object sender, AxEXTOOLBARLib._IToolBarEvents_SelectItemEvent e) { System.Diagnostics.Debug.Print( "SelectItem event on Itm object" ); } //this.axToolBar1.SelectItem += new AxEXTOOLBARLib._IToolBarEvents_SelectItemEventHandler(this.axToolBar1_SelectItem); EXTOOLBARLib.Items var_Items = axToolBar1.Items; var_Items.Add("Item",null,null); var_Items.Add("Item",null,null); axToolBar1.Refresh();
X++ (Dynamics Ax 2009)
// SelectItem event - Occurs when the user selects the item. void onEvent_SelectItem(COM _Itm) { ; print( "SelectItem event on Itm object" ); } public void init() { COM com_Items; anytype var_Items; ; super(); var_Items = extoolbar1.Items(); com_Items = var_Items; com_Items.Add("Item"); com_Items.Add("Item"); extoolbar1.Refresh(); }
Delphi 8 (.NET only)
// SelectItem event - Occurs when the user selects the item. procedure TWinForm1.AxToolBar1_SelectItem(sender: System.Object; e: AxEXTOOLBARLib._IToolBarEvents_SelectItemEvent); begin with AxToolBar1 do begin OutputDebugString( 'SelectItem event on Itm object' ); end end; with AxToolBar1 do begin with Items do begin Add('Item',Nil,Nil); Add('Item',Nil,Nil); end; Refresh(); end
Delphi (standard)
// SelectItem event - Occurs when the user selects the item. procedure TForm1.ToolBar1SelectItem(ASender: TObject; Itm : IItem); begin with ToolBar1 do begin OutputDebugString( 'SelectItem event on Itm object' ); end end; with ToolBar1 do begin with Items do begin Add('Item',Null,Null); Add('Item',Null,Null); end; Refresh(); end
VFP
*** SelectItem event - Occurs when the user selects the item. *** LPARAMETERS Itm with thisform.ToolBar1 DEBUGOUT( "SelectItem event on Itm object" ) endwith with thisform.ToolBar1 with .Items .Add("Item") .Add("Item") endwith .Refresh endwith
dBASE Plus
/* with (this.ACTIVEX1.nativeObject) SelectItem = class::nativeObject_SelectItem endwith */ // Occurs when the user selects the item. function nativeObject_SelectItem(Itm) local oToolBar oToolBar = form.Activex1.nativeObject ? "SelectItem event on Itm object" return local oToolBar,var_Items oToolBar = form.Activex1.nativeObject var_Items = oToolBar.Items var_Items.Add("Item") var_Items.Add("Item") oToolBar.Refresh()
XBasic (Alpha Five)
' Occurs when the user selects the item. function SelectItem as v (Itm as OLE::Exontrol.ToolBar.1::IItem) Dim oToolBar as P oToolBar = topparent:CONTROL_ACTIVEX1.activex ? "SelectItem event on Itm object" end function Dim oToolBar as P Dim var_Items as P oToolBar = topparent:CONTROL_ACTIVEX1.activex var_Items = oToolBar.Items var_Items.Add("Item") var_Items.Add("Item") oToolBar.Refresh()
Visual Objects
METHOD OCX_Exontrol1SelectItem(Itm) CLASS MainDialog // SelectItem event - Occurs when the user selects the item. OutputDebugString(String2Psz( "SelectItem event on Itm object" )) RETURN NIL local var_Items as IItems var_Items := oDCOCX_Exontrol1:Items var_Items:Add("Item",nil,nil) var_Items:Add("Item",nil,nil) oDCOCX_Exontrol1:Refresh()
PowerBuilder
/*begin event SelectItem(oleobject Itm) - Occurs when the user selects the item.*/ /* OleObject oToolBar oToolBar = ole_1.Object MessageBox("Information",string( "SelectItem event on Itm object" )) */ /*end event SelectItem*/ OleObject oToolBar,var_Items oToolBar = ole_1.Object var_Items = oToolBar.Items var_Items.Add("Item") var_Items.Add("Item") oToolBar.Refresh()
Visual DataFlex
// Occurs when the user selects the item. Procedure OnComSelectItem Variant llItm Forward Send OnComSelectItem llItm Showln "SelectItem 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 Get ComAdd of hoItems "Item" Nothing Nothing to Nothing Get ComAdd of hoItems "Item" Nothing Nothing to Nothing Send Destroy to hoItems Send ComRefresh End_Procedure
XBase++
PROCEDURE OnSelectItem(oToolBar,Itm) DevOut( "SelectItem 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:SelectItem := {|Itm| OnSelectItem(oToolBar,Itm)} /*Occurs when the user selects the item.*/ oItems := oToolBar:Items() oItems:Add("Item") oItems:Add("Item") oToolBar:Refresh() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN