event ActionContextMenu (Action as ContextMenuObjectActionEnum, ObjectType as ContextMenuObjectTypeEnum, ObjectID as Variant, CommandID as Long, CommandChecked as Boolean, CommandCaption as Variant, CommandValue as Variant, Cancel as Boolean)
Occurs when the user selects an item from the object's context menu.

TypeDescription
Action as ContextMenuObjectActionEnum A ContextMenuObjectActionEnum expression that specifies the action occurred in the control's context menu. 
ObjectType as ContextMenuObjectTypeEnum Indicates the type of the object where the action occurs. The ContextMenuObjectFromID property determines the object that hosts the context-menu, such as element, link, pool and so on.
ObjectID as Variant Specifies the unique identifier of the object which hosts the context menu. The ContextMenuObjectFromID property determines the object that hosts the context-menu, such as element, link, pool and so on.
CommandID as Long A long expression that specifies the identifier of the item being selected or clicked.
CommandChecked as Boolean A boolean expression that specifies whether the item is checked or unchecked. For instance, if the item has associated a check-box, the CommandChecked parameter determines the state of the item's checkbox.
CommandCaption as Variant A String expression that indicates the caption being shown on the item. The CommandCaption parameter specifies the item's label. Use the CommandValue parameter to determine the item's value. 
CommandValue as Variant A VARIANT expression that specifies the item's value. For instance, if the item displays a text-box, it indicates the value being displayed in the item's edit field.
Cancel as Boolean A Boolean expression that determines whether the default action should continue. This parameter has effect for the default items of the object's context menu.
The ActionContextMenu event notifies your application once an action occurs within the object's context menu. For instance, you can use the ActionContextMenu event to perform a specified operation once the user clicks/changes/selects an item from the control's context menu. The ContextMenuObjectFromID(ObjectType,ObjectID) property determines the object that hosts the context-menu, such as element, link, pool and so on. Use the ContextMenu property to provide a custom context menu for the objects on the surface. Use the AllowContextMenu property to specify the combination of keys that allows the user to open the object's context menu. The LayoutStartChanging(exActionContextMenuObject) / LayoutEndChanging(exActionContextMenuObject) events occurs once the user selects/clicks an item. 

By default, you can provide a context-menu for the following type of objects:

The object's context menu is shown only, if the control's DesignMode property is not exDesignLock. For instance, if the control's DesignMode property is exDesignElements, no pools is visible when the user is trying to right-click the pool ( no design-mode for pools ).

Syntax for ActionContextMenu event, /NET version, on:

private void ActionContextMenu(object sender,exontrol.EXSWIMLANELib.ContextMenuObjectActionEnum Action,exontrol.EXSWIMLANELib.ContextMenuObjectTypeEnum ObjectType,object ObjectID,int CommandID,bool CommandChecked,object CommandCaption,object CommandValue,ref bool Cancel)
{
}

Private Sub ActionContextMenu(ByVal sender As System.Object,ByVal Action As exontrol.EXSWIMLANELib.ContextMenuObjectActionEnum,ByVal ObjectType As exontrol.EXSWIMLANELib.ContextMenuObjectTypeEnum,ByVal ObjectID As Object,ByVal CommandID As Integer,ByVal CommandChecked As Boolean,ByVal CommandCaption As Object,ByVal CommandValue As Object,ByRef Cancel As Boolean) Handles ActionContextMenu
End Sub

Syntax for ActionContextMenu event, /COM version, on:

private void ActionContextMenu(object sender, AxEXSWIMLANELib._ISwimLaneEvents_ActionContextMenuEvent e)
{
}

void OnActionContextMenu(long Action,long ObjectType,VARIANT ObjectID,long CommandID,BOOL CommandChecked,VARIANT CommandCaption,VARIANT CommandValue,BOOL FAR* Cancel)
{
}

void __fastcall ActionContextMenu(TObject *Sender,Exswimlanelib_tlb::ContextMenuObjectActionEnum Action,Exswimlanelib_tlb::ContextMenuObjectTypeEnum ObjectType,Variant ObjectID,long CommandID,VARIANT_BOOL CommandChecked,Variant CommandCaption,Variant CommandValue,VARIANT_BOOL * Cancel)
{
}

procedure ActionContextMenu(ASender: TObject; Action : ContextMenuObjectActionEnum;ObjectType : ContextMenuObjectTypeEnum;ObjectID : OleVariant;CommandID : Integer;CommandChecked : WordBool;CommandCaption : OleVariant;CommandValue : OleVariant;var Cancel : WordBool);
begin
end;

procedure ActionContextMenu(sender: System.Object; e: AxEXSWIMLANELib._ISwimLaneEvents_ActionContextMenuEvent);
begin
end;

begin event ActionContextMenu(long Action,long ObjectType,any ObjectID,long CommandID,boolean CommandChecked,any CommandCaption,any CommandValue,boolean Cancel)
end event ActionContextMenu

Private Sub ActionContextMenu(ByVal sender As System.Object, ByVal e As AxEXSWIMLANELib._ISwimLaneEvents_ActionContextMenuEvent) Handles ActionContextMenu
End Sub

Private Sub ActionContextMenu(ByVal Action As EXSWIMLANELibCtl.ContextMenuObjectActionEnum,ByVal ObjectType As EXSWIMLANELibCtl.ContextMenuObjectTypeEnum,ByVal ObjectID As Variant,ByVal CommandID As Long,ByVal CommandChecked As Boolean,ByVal CommandCaption As Variant,ByVal CommandValue As Variant,Cancel As Boolean)
End Sub

Private Sub ActionContextMenu(ByVal Action As Long,ByVal ObjectType As Long,ByVal ObjectID As Variant,ByVal CommandID As Long,ByVal CommandChecked As Boolean,ByVal CommandCaption As Variant,ByVal CommandValue As Variant,Cancel As Boolean)
End Sub

LPARAMETERS Action,ObjectType,ObjectID,CommandID,CommandChecked,CommandCaption,CommandValue,Cancel

PROCEDURE OnActionContextMenu(oSwimLane,Action,ObjectType,ObjectID,CommandID,CommandChecked,CommandCaption,CommandValue,Cancel)
RETURN

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

<SCRIPT EVENT="ActionContextMenu(Action,ObjectType,ObjectID,CommandID,CommandChecked,CommandCaption,CommandValue,Cancel)" LANGUAGE="JScript">
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Function ActionContextMenu(Action,ObjectType,ObjectID,CommandID,CommandChecked,CommandCaption,CommandValue,Cancel)
End Function
</SCRIPT>

Procedure OnComActionContextMenu OLEContextMenuObjectActionEnum llAction OLEContextMenuObjectTypeEnum llObjectType Variant llObjectID Integer llCommandID Boolean llCommandChecked Variant llCommandCaption Variant llCommandValue Boolean llCancel
	Forward Send OnComActionContextMenu llAction llObjectType llObjectID llCommandID llCommandChecked llCommandCaption llCommandValue llCancel
End_Procedure

METHOD OCX_ActionContextMenu(Action,ObjectType,ObjectID,CommandID,CommandChecked,CommandCaption,CommandValue,Cancel) CLASS MainDialog
RETURN NIL

void onEvent_ActionContextMenu(int _Action,int _ObjectType,COMVariant _ObjectID,int _CommandID,boolean _CommandChecked,COMVariant _CommandCaption,COMVariant _CommandValue,COMVariant /*bool*/ _Cancel)
{
}

function ActionContextMenu as v (Action as OLE::Exontrol.SwimLane.1::ContextMenuObjectActionEnum,ObjectType as OLE::Exontrol.SwimLane.1::ContextMenuObjectTypeEnum,ObjectID as A,CommandID as N,CommandChecked as L,CommandCaption as A,CommandValue as A,Cancel as L)
end function

function nativeObject_ActionContextMenu(Action,ObjectType,ObjectID,CommandID,CommandChecked,CommandCaption,CommandValue,Cancel)
return

The following samples show how you can change/handle the element's context-menu when the user right-clicks the element:

VBA (MS Access, Excell...)

' ActionContextMenu event - Occurs when the user selects an item from the object's context menu.
Private Sub SwimLane1_ActionContextMenu(ByVal Action As Long,ByVal ObjectType As Long,ByVal ObjectID As Variant,ByVal CommandID As Long,ByVal CommandChecked As Boolean,ByVal CommandCaption As Variant,ByVal CommandValue As Variant,Cancel As Boolean)
	With SwimLane1
		Debug.Print( Action )
		Debug.Print( CommandCaption )
	End With
End Sub

With SwimLane1
	.BeginUpdate 
	.Elements.Add "element",0,0
	.ContextMenu(4) = "Simple,Value[edit=123],[sep],Popup(Check 1[chk],Check 2[chk=1])"
	.EndUpdate 
End With

VB6

' ActionContextMenu event - Occurs when the user selects an item from the object's context menu.
Private Sub SwimLane1_ActionContextMenu(ByVal Action As EXSWIMLANELibCtl.ContextMenuObjectActionEnum,ByVal ObjectType As EXSWIMLANELibCtl.ContextMenuObjectTypeEnum,ByVal ObjectID As Variant,ByVal CommandID As Long,ByVal CommandChecked As Boolean,ByVal CommandCaption As Variant,ByVal CommandValue As Variant,Cancel As Boolean)
	With SwimLane1
		Debug.Print( Action )
		Debug.Print( CommandCaption )
	End With
End Sub

With SwimLane1
	.BeginUpdate 
	.Elements.Add "element",0,0
	.ContextMenu(exContextMenuElement) = "Simple,Value[edit=123],[sep],Popup(Check 1[chk],Check 2[chk=1])"
	.EndUpdate 
End With

VB.NET

' ActionContextMenu event - Occurs when the user selects an item from the object's context menu.
Private Sub Exswimlane1_ActionContextMenu(ByVal sender As System.Object,ByVal Action As exontrol.EXSWIMLANELib.ContextMenuObjectActionEnum,ByVal ObjectType As exontrol.EXSWIMLANELib.ContextMenuObjectTypeEnum,ByVal ObjectID As Object,ByVal CommandID As Integer,ByVal CommandChecked As Boolean,ByVal CommandCaption As Object,ByVal CommandValue As Object,ByRef Cancel As Boolean) Handles Exswimlane1.ActionContextMenu
	With Exswimlane1
		Debug.Print( Action )
		Debug.Print( CommandCaption )
	End With
End Sub

With Exswimlane1
	.BeginUpdate()
	.Elements.Add("element",0,0)
	.set_ContextMenu(exontrol.EXSWIMLANELib.ContextMenuObjectTypeEnum.exContextMenuElement,"Simple,Value[edit=123],[sep],Popup(Check 1[chk],Check 2[chk=1])")
	.EndUpdate()
End With

VB.NET for /COM

' ActionContextMenu event - Occurs when the user selects an item from the object's context menu.
Private Sub AxSwimLane1_ActionContextMenu(ByVal sender As System.Object, ByVal e As AxEXSWIMLANELib._ISwimLaneEvents_ActionContextMenuEvent) Handles AxSwimLane1.ActionContextMenu
	With AxSwimLane1
		Debug.Print( e.action )
		Debug.Print( e.commandCaption )
	End With
End Sub

With AxSwimLane1
	.BeginUpdate()
	.Elements.Add("element",0,0)
	.set_ContextMenu(EXSWIMLANELib.ContextMenuObjectTypeEnum.exContextMenuElement,"Simple,Value[edit=123],[sep],Popup(Check 1[chk],Check 2[chk=1])")
	.EndUpdate()
End With

C++

// ActionContextMenu event - Occurs when the user selects an item from the object's context menu.
void OnActionContextMenuSwimLane1(long Action,long ObjectType,VARIANT ObjectID,long CommandID,BOOL CommandChecked,VARIANT CommandCaption,VARIANT CommandValue,BOOL FAR* Cancel)
{
	/*
		Copy and paste the following directives to your header file as
		it defines the namespace 'EXSWIMLANELib' for the library: 'ExSwimLane 1.0 Control Library'
		#import <ExSwimLane.dll>
		using namespace EXSWIMLANELib;
	*/
	EXSWIMLANELib::ISwimLanePtr spSwimLane1 = GetDlgItem(IDC_SWIMLANE1)->GetControlUnknown();
	OutputDebugStringW( L"Action" );
	OutputDebugStringW( L"CommandCaption" );
}

EXSWIMLANELib::ISwimLanePtr spSwimLane1 = GetDlgItem(IDC_SWIMLANE1)->GetControlUnknown();
spSwimLane1->BeginUpdate();
spSwimLane1->GetElements()->Add("element",long(0),long(0));
spSwimLane1->PutContextMenu(EXSWIMLANELib::exContextMenuElement,L"Simple,Value[edit=123],[sep],Popup(Check 1[chk],Check 2[chk=1])");
spSwimLane1->EndUpdate();

C++ Builder

// ActionContextMenu event - Occurs when the user selects an item from the object's context menu.
void __fastcall TForm1::SwimLane1ActionContextMenu(TObject *Sender,Exswimlanelib_tlb::ContextMenuObjectActionEnum Action,Exswimlanelib_tlb::ContextMenuObjectTypeEnum ObjectType,Variant ObjectID,long CommandID,VARIANT_BOOL CommandChecked,Variant CommandCaption,Variant CommandValue,VARIANT_BOOL * Cancel)
{
	OutputDebugString( L"Action" );
	OutputDebugString( L"CommandCaption" );
}

SwimLane1->BeginUpdate();
SwimLane1->Elements->Add(TVariant("element"),TVariant(0),TVariant(0));
SwimLane1->ContextMenu[Exswimlanelib_tlb::ContextMenuObjectTypeEnum::exContextMenuElement] = L"Simple,Value[edit=123],[sep],Popup(Check 1[chk],Check 2[chk=1])";
SwimLane1->EndUpdate();

C#

// ActionContextMenu event - Occurs when the user selects an item from the object's context menu.
private void exswimlane1_ActionContextMenu(object sender,exontrol.EXSWIMLANELib.ContextMenuObjectActionEnum Action,exontrol.EXSWIMLANELib.ContextMenuObjectTypeEnum ObjectType,object ObjectID,int CommandID,bool CommandChecked,object CommandCaption,object CommandValue,ref bool Cancel)
{
	System.Diagnostics.Debug.Print( Action.ToString() );
	System.Diagnostics.Debug.Print( CommandCaption.ToString() );
}
//this.exswimlane1.ActionContextMenu += new exontrol.EXSWIMLANELib.exg2antt.ActionContextMenuEventHandler(this.exswimlane1_ActionContextMenu);

exswimlane1.BeginUpdate();
exswimlane1.Elements.Add("element",0,0);
exswimlane1.set_ContextMenu(exontrol.EXSWIMLANELib.ContextMenuObjectTypeEnum.exContextMenuElement,"Simple,Value[edit=123],[sep],Popup(Check 1[chk],Check 2[chk=1])");
exswimlane1.EndUpdate();

JScript/JavaScript

<BODY onload="Init()">
<SCRIPT FOR="SwimLane1" EVENT="ActionContextMenu(Action,ObjectType,ObjectID,CommandID,CommandChecked,CommandCaption,CommandValue,Cancel)" LANGUAGE="JScript">
	alert( Action );
	alert( CommandCaption );
</SCRIPT>

<OBJECT CLASSID="clsid:AFA73FCE-6609-4062-AE6A-4BAD6D96A025" id="SwimLane1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
	SwimLane1.BeginUpdate();
	SwimLane1.Elements.Add("element",0,0);
	SwimLane1.ContextMenu(4) = "Simple,Value[edit=123],[sep],Popup(Check 1[chk],Check 2[chk=1])";
	SwimLane1.EndUpdate();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload="Init()">
<SCRIPT LANGUAGE="VBScript">
Function SwimLane1_ActionContextMenu(Action,ObjectType,ObjectID,CommandID,CommandChecked,CommandCaption,CommandValue,Cancel)
	With SwimLane1
		alert( Action )
		alert( CommandCaption )
	End With
End Function
</SCRIPT>

<OBJECT CLASSID="clsid:AFA73FCE-6609-4062-AE6A-4BAD6D96A025" id="SwimLane1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
	With SwimLane1
		.BeginUpdate 
		.Elements.Add "element",0,0
		.ContextMenu(4) = "Simple,Value[edit=123],[sep],Popup(Check 1[chk],Check 2[chk=1])"
		.EndUpdate 
	End With
End Function
</SCRIPT>
</BODY>

C# for /COM

// ActionContextMenu event - Occurs when the user selects an item from the object's context menu.
private void axSwimLane1_ActionContextMenu(object sender, AxEXSWIMLANELib._ISwimLaneEvents_ActionContextMenuEvent e)
{
	System.Diagnostics.Debug.Print( e.action.ToString() );
	System.Diagnostics.Debug.Print( e.commandCaption.ToString() );
}
//this.axSwimLane1.ActionContextMenu += new AxEXSWIMLANELib._ISwimLaneEvents_ActionContextMenuEventHandler(this.axSwimLane1_ActionContextMenu);

axSwimLane1.BeginUpdate();
axSwimLane1.Elements.Add("element",0,0);
axSwimLane1.set_ContextMenu(EXSWIMLANELib.ContextMenuObjectTypeEnum.exContextMenuElement,"Simple,Value[edit=123],[sep],Popup(Check 1[chk],Check 2[chk=1])");
axSwimLane1.EndUpdate();

X++ (Dynamics Ax 2009)

// ActionContextMenu event - Occurs when the user selects an item from the object's context menu.
void onEvent_ActionContextMenu(int _Action,int _ObjectType,COMVariant _ObjectID,int _CommandID,boolean _CommandChecked,COMVariant _CommandCaption,COMVariant _CommandValue,COMVariant /*bool*/ _Cancel)
{
	;
	print( _Action );
	print( _CommandCaption );
}

public void init()
{
	;

	super();

	exswimlane1.BeginUpdate();
	exswimlane1.Elements().Add("element",COMVariant::createFromInt(0),COMVariant::createFromInt(0));
	exswimlane1.ContextMenu(4/*exContextMenuElement*/,"Simple,Value[edit=123],[sep],Popup(Check 1[chk],Check 2[chk=1])");
	exswimlane1.EndUpdate();
}

Delphi 8 (.NET only)

// ActionContextMenu event - Occurs when the user selects an item from the object's context menu.
procedure TWinForm1.AxSwimLane1_ActionContextMenu(sender: System.Object; e: AxEXSWIMLANELib._ISwimLaneEvents_ActionContextMenuEvent);
begin
	with AxSwimLane1 do
	begin
		OutputDebugString( e.action );
		OutputDebugString( e.commandCaption );
	end
end;

with AxSwimLane1 do
begin
	BeginUpdate();
	Elements.Add('element',TObject(0),TObject(0));
	set_ContextMenu(EXSWIMLANELib.ContextMenuObjectTypeEnum.exContextMenuElement,'Simple,Value[edit=123],[sep],Popup(Check 1[chk],Check 2[chk=1])');
	EndUpdate();
end

Delphi (standard)

// ActionContextMenu event - Occurs when the user selects an item from the object's context menu.
procedure TForm1.SwimLane1ActionContextMenu(ASender: TObject; Action : ContextMenuObjectActionEnum;ObjectType : ContextMenuObjectTypeEnum;ObjectID : OleVariant;CommandID : Integer;CommandChecked : WordBool;CommandCaption : OleVariant;CommandValue : OleVariant;var Cancel : WordBool);
begin
	with SwimLane1 do
	begin
		OutputDebugString( Action );
		OutputDebugString( CommandCaption );
	end
end;

with SwimLane1 do
begin
	BeginUpdate();
	Elements.Add('element',OleVariant(0),OleVariant(0));
	ContextMenu[EXSWIMLANELib_TLB.exContextMenuElement] := 'Simple,Value[edit=123],[sep],Popup(Check 1[chk],Check 2[chk=1])';
	EndUpdate();
end

VFP

*** ActionContextMenu event - Occurs when the user selects an item from the object's context menu. ***
LPARAMETERS Action,ObjectType,ObjectID,CommandID,CommandChecked,CommandCaption,CommandValue,Cancel
	with thisform.SwimLane1
		DEBUGOUT( Action )
		DEBUGOUT( CommandCaption )
	endwith

with thisform.SwimLane1
	.BeginUpdate
	.Elements.Add("element",0,0)
	.Object.ContextMenu(4) = "Simple,Value[edit=123],[sep],Popup(Check 1[chk],Check 2[chk=1])"
	.EndUpdate
endwith

dBASE Plus

/*
with (this.EXSWIMLANEACTIVEXCONTROL1.nativeObject)
	ActionContextMenu = class::nativeObject_ActionContextMenu
endwith
*/
// Occurs when the user selects an item from the object's context menu.
function nativeObject_ActionContextMenu(Action,ObjectType,ObjectID,CommandID,CommandChecked,CommandCaption,CommandValue,Cancel)
	local oSwimLane
	oSwimLane = form.EXSWIMLANEACTIVEXCONTROL1.nativeObject
	? Str(Action) 
	? Str(CommandCaption) 
return

local oSwimLane

oSwimLane = form.EXSWIMLANEACTIVEXCONTROL1.nativeObject
oSwimLane.BeginUpdate()
oSwimLane.Elements.Add("element",0,0)
oSwimLane.Template = [ContextMenu(4) = "Simple,Value[edit=123],[sep],Popup(Check 1[chk],Check 2[chk=1])"] // oSwimLane.ContextMenu(4) = "Simple,Value[edit=123],[sep],Popup(Check 1[chk],Check 2[chk=1])"
oSwimLane.EndUpdate()

XBasic (Alpha Five)

' Occurs when the user selects an item from the object's context menu.
function ActionContextMenu as v (Action as OLE::Exontrol.SwimLane.1::ContextMenuObjectActionEnum,ObjectType as OLE::Exontrol.SwimLane.1::ContextMenuObjectTypeEnum,ObjectID as A,CommandID as N,CommandChecked as L,CommandCaption as A,CommandValue as A,Cancel as L)
	Dim oSwimLane as P
	oSwimLane = topparent:CONTROL_ACTIVEX1.activex
	? Action 
	? CommandCaption 
end function

Dim oSwimLane as P

oSwimLane = topparent:CONTROL_ACTIVEX1.activex
oSwimLane.BeginUpdate()
oSwimLane.Elements.Add("element",0,0)
oSwimLane.Template = "ContextMenu(4) = `Simple,Value[edit=123],[sep],Popup(Check 1[chk],Check 2[chk=1])`" // oSwimLane.ContextMenu(4) = "Simple,Value[edit=123],[sep],Popup(Check 1[chk],Check 2[chk=1])"
oSwimLane.EndUpdate()

Visual Objects

METHOD OCX_Exontrol1ActionContextMenu(Action,ObjectType,ObjectID,CommandID,CommandChecked,CommandCaption,CommandValue,Cancel) CLASS MainDialog
	// ActionContextMenu event - Occurs when the user selects an item from the object's context menu.
	OutputDebugString(String2Psz( AsString(Action) ))
	OutputDebugString(String2Psz( AsString(CommandCaption) ))
RETURN NIL


oDCOCX_Exontrol1:BeginUpdate()
oDCOCX_Exontrol1:Elements:Add("element",0,0)
oDCOCX_Exontrol1:[ContextMenu,exContextMenuElement] := "Simple,Value[edit=123],[sep],Popup(Check 1[chk],Check 2[chk=1])"
oDCOCX_Exontrol1:EndUpdate()

PowerBuilder

/*begin event ActionContextMenu(long Action,long ObjectType,any ObjectID,long CommandID,boolean CommandChecked,any CommandCaption,any CommandValue,boolean Cancel) - Occurs when the user selects an item from the object's context menu.*/
/*
	OleObject oSwimLane
	oSwimLane = ole_1.Object
	MessageBox("Information",string( String(Action) ))
	MessageBox("Information",string( String(CommandCaption) ))
*/
/*end event ActionContextMenu*/

OleObject oSwimLane

oSwimLane = ole_1.Object
oSwimLane.BeginUpdate()
oSwimLane.Elements.Add("element",0,0)
oSwimLane.ContextMenu(4,"Simple,Value[edit=123],[sep],Popup(Check 1[chk],Check 2[chk=1])")
oSwimLane.EndUpdate()

Visual DataFlex

// Occurs when the user selects an item from the object's context menu.
Procedure OnComActionContextMenu OLEContextMenuObjectActionEnum llAction OLEContextMenuObjectTypeEnum llObjectType Variant llObjectID Integer llCommandID Boolean llCommandChecked Variant llCommandCaption Variant llCommandValue Boolean llCancel
	Forward Send OnComActionContextMenu llAction llObjectType llObjectID llCommandID llCommandChecked llCommandCaption llCommandValue llCancel
	Showln llAction llCommandCaption
End_Procedure

Procedure OnCreate
	Forward Send OnCreate
	Send ComBeginUpdate
	Variant voElements
	Get ComElements to voElements
	Handle hoElements
	Get Create (RefClass(cComElements)) to hoElements
	Set pvComObject of hoElements to voElements
		Get ComAdd of hoElements "element" 0 0 to Nothing
	Send Destroy to hoElements
	Set ComContextMenu OLEexContextMenuElement to "Simple,Value[edit=123],[sep],Popup(Check 1[chk],Check 2[chk=1])"
	Send ComEndUpdate
End_Procedure

XBase++

PROCEDURE OnActionContextMenu(oSwimLane,Action,ObjectType,ObjectID,CommandID,CommandChecked,CommandCaption,CommandValue,Cancel)
	DevOut( Transform(Action,"") )
	DevOut( Transform(CommandCaption,"") )
RETURN

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

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

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

	oSwimLane := XbpActiveXControl():new( oForm:drawingArea )
	oSwimLane:CLSID  := "Exontrol.SwimLane.1" /*{AFA73FCE-6609-4062-AE6A-4BAD6D96A025}*/
	oSwimLane:create(,, {10,60},{610,370} )

		oSwimLane:ActionContextMenu := {|Action,ObjectType,ObjectID,CommandID,CommandChecked,CommandCaption,CommandValue,Cancel| OnActionContextMenu(oSwimLane,Action,ObjectType,ObjectID,CommandID,CommandChecked,CommandCaption,CommandValue,Cancel)} /*Occurs when the user selects an item from the object's context menu.*/

		oSwimLane:BeginUpdate()
		oSwimLane:Elements():Add("element",0,0)
		oSwimLane:SetProperty("ContextMenu",4/*exContextMenuElement*/,"Simple,Value[edit=123],[sep],Popup(Check 1[chk],Check 2[chk=1])")
		oSwimLane:EndUpdate()

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