event OleEvent (Itm as Item, Ev as OleEvent)
Occurs when an inside ActiveX control fires an event.

TypeDescription
Itm as Item An Item object that contains the sub-control.
Ev as OleEvent An OleEvent object that holds information about the fired event. 
The eXContextMenu component may include sub-menus that displays any ActiveX / NET Component. The inside COM/ActiveX control fires its events through the ExContextMenu's OleEvent event. Use the ItemTypeEnum.SubControl to add an item that hosts an ActiveX inside. Use the SubControl property to access the properties to create the inside ActiveX control.

The following screen shot displays an item with an ExSlider inside:

3

The following screen shot displays an item with an ExCalendar inside:

Syntax for OleEvent event, /NET version, on:

private void OleEvent(object sender,exontrol.EXCONTEXTMENULib.item Itm,exontrol.EXCONTEXTMENULib.OleEvent Ev)
{
}

Private Sub OleEvent(ByVal sender As System.Object,ByVal Itm As exontrol.EXCONTEXTMENULib.item,ByVal Ev As exontrol.EXCONTEXTMENULib.OleEvent) Handles OleEvent
End Sub

Syntax for OleEvent event, /COM version, on:

private void OleEvent(object sender, AxEXCONTEXTMENULib._IExContextMenuEvents_OleEventEvent e)
{
}

void OnOleEvent(LPDISPATCH Itm,LPDISPATCH Ev)
{
}

void __fastcall OleEvent(TObject *Sender,Excontextmenulib_tlb::IItem *Itm,Excontextmenulib_tlb::IOleEvent *Ev)
{
}

procedure OleEvent(ASender: TObject; Itm : IItem;Ev : IOleEvent);
begin
end;

procedure OleEvent(sender: System.Object; e: AxEXCONTEXTMENULib._IExContextMenuEvents_OleEventEvent);
begin
end;

begin event OleEvent(oleobject Itm,oleobject Ev)
end event OleEvent

Private Sub OleEvent(ByVal sender As System.Object, ByVal e As AxEXCONTEXTMENULib._IExContextMenuEvents_OleEventEvent) Handles OleEvent
End Sub

Private Sub OleEvent(ByVal Itm As EXCONTEXTMENULibCtl.IItem,ByVal Ev As EXCONTEXTMENULibCtl.IOleEvent)
End Sub

Private Sub OleEvent(ByVal Itm As Object,ByVal Ev As Object)
End Sub

LPARAMETERS Itm,Ev

PROCEDURE OnOleEvent(oExContextMenu,Itm,Ev)
RETURN

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

<SCRIPT EVENT="OleEvent(Itm,Ev)" LANGUAGE="JScript">
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Function OleEvent(Itm,Ev)
End Function
</SCRIPT>

Procedure OnComOleEvent Variant llItm Variant llEv
	Forward Send OnComOleEvent llItm llEv
End_Procedure

METHOD OCX_OleEvent(Itm,Ev) CLASS MainDialog
RETURN NIL

void onEvent_OleEvent(COM _Itm,COM _Ev)
{
}

function OleEvent as v (Itm as OLE::Exontrol.ContextMenu.1::IItem,Ev as OLE::Exontrol.ContextMenu.1::IOleEvent)
end function

function nativeObject_OleEvent(Itm,Ev)
return

The following samples shows how to load an ActiveX control ( Exontrol.Calendar )

VB6,VBA (MS Access, Excell...),VB.NET for /COM

With CreateObject("Exontrol.ContextMenu")
	With .Items.Add("Calendar",3).SubControl
		.ControlID = "Exontrol.Calendar"
		.Create 
	End With
	.Select 
End With

VB.NET

' Add 'exontrol.excontextmenu.dll' reference to your project.
With New exontrol.EXCONTEXTMENULib.excontextmenu()
	With .Items.Add("Calendar",3).SubControl
		.ControlID = "Exontrol.Calendar"
		.Create()
	End With
	.Select()
End With

C++

/*
	Includes the definition for CreateObject function like follows:
	#include <comdef.h>
	IUnknownPtr CreateObject( BSTR Object )
	{
		IUnknownPtr spResult;
		spResult.CreateInstance( Object );
		return spResult;
	};
*/
/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXCONTEXTMENULib' for the library: 'ExContextMenu 1.0 Type Library'
	#import <ExContextMenu.dll>
	using namespace EXCONTEXTMENULib;
*/
EXCONTEXTMENULib::IExContextMenuPtr var_ExContextMenu = ::CreateObject(L"Exontrol.ContextMenu");
	EXCONTEXTMENULib::IControlPtr var_Control = var_ExContextMenu->GetItems()->Add(L"Calendar",long(3),vtMissing)->GetSubControl();
		var_Control->PutControlID(L"Exontrol.Calendar");
		var_Control->Create();
	var_ExContextMenu->Select(vtMissing,vtMissing,vtMissing);

C++ Builder

/*
	Select the Component\Import Component...\Import a Type Library,
	to import the following Type Library:
		ExContextMenu 1.0 Type Library
	TypeLib: e:\Exontrol\ExContextMenu\project\Site\ExContextMenu.dll
	to define the namespace: Excontextmenulib_tlb
*/
//#include "EXCONTEXTMENULIB_TLB.h"
Excontextmenulib_tlb::IExContextMenuPtr var_ExContextMenu = Variant::CreateObject(L"Exontrol.ContextMenu");
	Excontextmenulib_tlb::IControlPtr var_Control = var_ExContextMenu->Items->Add(L"Calendar",TVariant(3),TNoParam())->SubControl;
		var_Control->ControlID = L"Exontrol.Calendar";
		var_Control->Create();
	var_ExContextMenu->Select(TNoParam(),TNoParam(),TNoParam());

C#

// Add 'exontrol.excontextmenu.dll' reference to your project.
exontrol.EXCONTEXTMENULib.excontextmenu var_ExContextMenu = new exontrol.EXCONTEXTMENULib.excontextmenu();
	exontrol.EXCONTEXTMENULib.Control var_Control = var_ExContextMenu.Items.Add("Calendar",3,null).SubControl;
		var_Control.ControlID = "Exontrol.Calendar";
		var_Control.Create();
	var_ExContextMenu.Select(null,null,null);

C# for /COM

// Add 'ExContextMenu 1.0 Type Library' reference to your project.
EXCONTEXTMENULib.ExContextMenu var_ExContextMenu = new EXCONTEXTMENULib.ExContextMenu();
	EXCONTEXTMENULib.Control var_Control = var_ExContextMenu.Items.Add("Calendar",3,null).SubControl;
		var_Control.ControlID = "Exontrol.Calendar";
		var_Control.Create();
	var_ExContextMenu.Select(null,null,null);

X++ (Dynamics Ax 2009)

COM com_Control,com_ExContextMenu,com_Items,com_item;
anytype var_Control,var_ExContextMenu,var_Items,var_item;
;
// Add 'ExContextMenu 1.0 Type Library' reference to your project.
var_ExContextMenu = COM::createFromObject(new EXCONTEXTMENULib.excontextmenu()); com_ExContextMenu = var_ExContextMenu;
	var_Items = COM::createFromObject(com_ExContextMenu.Items()); com_Items = var_Items;
	var_item = COM::createFromObject(com_Items).Add("Calendar",COMVariant::createFromInt(3)); com_item = var_item;
	var_Control = com_item.SubControl(); com_Control = var_Control;
		com_Control.ControlID("Exontrol.Calendar");
		com_Control.Create();
	com_ExContextMenu.Select();

Delphi 8 (.NET only)

with (ComObj.CreateComObject(ComObj.ProgIDToClassID('Exontrol.ContextMenu')) as EXCONTEXTMENULib.ExContextMenu) do
begin
	with Items.Add('Calendar',TObject(3),Nil).SubControl do
	begin
		ControlID := 'Exontrol.Calendar';
		Create();
	end;
	Select(Nil,Nil,Nil);
end;

Delphi (standard)

with (IUnknown(ComObj.CreateComObject(ComObj.ProgIDToClassID('Exontrol.ContextMenu'))) as EXCONTEXTMENULib_TLB.ExContextMenu) do
begin
	with Items.Add('Calendar',OleVariant(3),Null).SubControl do
	begin
		ControlID := 'Exontrol.Calendar';
		Create();
	end;
	Select(Null,Null,Null);
end;

VFP

with CreateObject("Exontrol.ContextMenu")
	with .Items.Add("Calendar",3).SubControl
		.ControlID = "Exontrol.Calendar"
		.Create
	endwith
	.Select()
endwith

XBasic (Alpha Five)

' Occurs when the user presses and then releases the left mouse button over the control.
function Click as v ()
	Dim oPivot as P
	Dim var_Control as P
	Dim var_ExContextMenu as P
	oPivot = topparent:CONTROL_ACTIVEX1.activex
	var_ExContextMenu = OLE.Create("Exontrol.ContextMenu")
		var_Control = var_ExContextMenu.Items.Add("Calendar",3).SubControl
			var_Control.ControlID = "Exontrol.Calendar"
			var_Control.Create()
		var_ExContextMenu.Select()
end function

Dim oPivot as P

oPivot = topparent:CONTROL_ACTIVEX1.activex

Visual Objects

local var_ExContextMenu as IExContextMenu
// Generate Source for 'ExContextMenu 1.0 Type Library' server from Tools\Automation Server...
var_ExContextMenu := IExContextMenu{"Exontrol.ContextMenu"}
	var_Control := var_ExContextMenu:Items:Add("Calendar",3,nil):SubControl
		var_Control:ControlID := "Exontrol.Calendar"
		var_Control:Create()
	var_ExContextMenu:Select(nil,nil,nil)