Type | Description |
In case you are using the /NET assembly version, you can use the Window property to assign a Window/Control to an Item.
The following screen shot displays an item with an ExCalendar inside:
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)