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 )
VBA (MS Access, Excell...)
With Ribbon1 With .Items.Add("Calendar",3).SubControl .Width = 256 .Height = 256 .ControlID = "Exontrol.Calendar" .Create End With .Refresh End With
VB6
With Ribbon1 With .Items.Add("Calendar",3).SubControl .Width = 256 .Height = 256 .ControlID = "Exontrol.Calendar" .Create End With .Refresh End With
VB.NET
With Exribbon1 With .Items.Add("Calendar",3).SubControl .Width = 256 .Height = 256 .ControlID = "Exontrol.Calendar" .Create() End With .Refresh() End With
VB.NET for /COM
With AxRibbon1 With .Items.Add("Calendar",3).SubControl .Width = 256 .Height = 256 .ControlID = "Exontrol.Calendar" .Create() End With .Refresh() End With
C++
/* 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(); EXRIBBONLib::IControlPtr var_Control = spRibbon1->GetItems()->Add(L"Calendar",long(3),vtMissing)->GetSubControl(); var_Control->PutWidth(256); var_Control->PutHeight(256); var_Control->PutControlID(L"Exontrol.Calendar"); var_Control->Create(); spRibbon1->Refresh();
C++ Builder
Exribbonlib_tlb::IControlPtr var_Control = Ribbon1->Items->Add(L"Calendar",TVariant(3),TNoParam())->SubControl; var_Control->Width = 256; var_Control->Height = 256; var_Control->ControlID = L"Exontrol.Calendar"; var_Control->Create(); Ribbon1->Refresh();
C#
exontrol.EXRIBBONLib.Control var_Control = exribbon1.Items.Add("Calendar",3,null).SubControl; var_Control.Width = 256; var_Control.Height = 256; var_Control.ControlID = "Exontrol.Calendar"; var_Control.Create(); exribbon1.Refresh();
JScript/JavaScript
<BODY onload='Init()'> <OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="Ribbon1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { var var_Control = Ribbon1.Items.Add("Calendar",3,null).SubControl; var_Control.Width = 256; var_Control.Height = 256; var_Control.ControlID = "Exontrol.Calendar"; var_Control.Create(); Ribbon1.Refresh(); } </SCRIPT> </BODY>
VBScript
<BODY onload='Init()'> <OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="Ribbon1"></OBJECT> <SCRIPT LANGUAGE="VBScript"> Function Init() With Ribbon1 With .Items.Add("Calendar",3).SubControl .Width = 256 .Height = 256 .ControlID = "Exontrol.Calendar" .Create End With .Refresh End With End Function </SCRIPT> </BODY>
C# for /COM
EXRIBBONLib.Control var_Control = axRibbon1.Items.Add("Calendar",3,null).SubControl; var_Control.Width = 256; var_Control.Height = 256; var_Control.ControlID = "Exontrol.Calendar"; var_Control.Create(); axRibbon1.Refresh();
X++ (Dynamics Ax 2009)
public void init() { COM com_Control,com_Item; anytype var_Control,var_Item; ; super(); var_Item = COM::createFromObject(exribbon1.Items()).Add("Calendar",COMVariant::createFromInt(3)); com_Item = var_Item; var_Control = com_Item.SubControl(); com_Control = var_Control; com_Control.Width(256); com_Control.Height(256); com_Control.ControlID("Exontrol.Calendar"); com_Control.Create(); exribbon1.Refresh(); }
Delphi 8 (.NET only)
with AxRibbon1 do begin with Items.Add('Calendar',TObject(3),Nil).SubControl do begin Width := 256; Height := 256; ControlID := 'Exontrol.Calendar'; Create(); end; Refresh(); end
Delphi (standard)
with Ribbon1 do begin with Items.Add('Calendar',OleVariant(3),Null).SubControl do begin Width := 256; Height := 256; ControlID := 'Exontrol.Calendar'; Create(); end; Refresh(); end
VFP
with thisform.Ribbon1 with .Items.Add("Calendar",3).SubControl .Width = 256 .Height = 256 .ControlID = "Exontrol.Calendar" .Create endwith .Refresh endwith
dBASE Plus
local oRibbon,var_Control oRibbon = form.Activex1.nativeObject var_Control = oRibbon.Items.Add("Calendar",3).SubControl var_Control.Width = 256 var_Control.Height = 256 var_Control.ControlID = "Exontrol.Calendar" var_Control.Create() oRibbon.Refresh()
XBasic (Alpha Five)
Dim oRibbon as P Dim var_Control as P oRibbon = topparent:CONTROL_ACTIVEX1.activex var_Control = oRibbon.Items.Add("Calendar",3).SubControl var_Control.Width = 256 var_Control.Height = 256 var_Control.ControlID = "Exontrol.Calendar" var_Control.Create() oRibbon.Refresh()
Visual Objects
local var_Control as IControl var_Control := oDCOCX_Exontrol1:Items:Add("Calendar",3,nil):SubControl var_Control:Width := 256 var_Control:Height := 256 var_Control:ControlID := "Exontrol.Calendar" var_Control:Create() oDCOCX_Exontrol1:Refresh()
PowerBuilder
OleObject oRibbon,var_Control oRibbon = ole_1.Object var_Control = oRibbon.Items.Add("Calendar",3).SubControl var_Control.Width = 256 var_Control.Height = 256 var_Control.ControlID = "Exontrol.Calendar" var_Control.Create() oRibbon.Refresh()
Visual DataFlex
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 "Calendar" 3 Nothing to voItem Handle hoItem Get Create (RefClass(cComItem)) to hoItem Set pvComObject of hoItem to voItem Variant voControl Get ComSubControl of hoItem to voControl Handle hoControl Get Create (RefClass(cComControl)) to hoControl Set pvComObject of hoControl to voControl Set ComWidth of hoControl to 256 Set ComHeight of hoControl to 256 Set ComControlID of hoControl to "Exontrol.Calendar" Send ComCreate of hoControl Send Destroy to hoControl Send Destroy to hoItem Send Destroy to hoItems Send ComRefresh End_Procedure
XBase++
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oControl 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} ) oControl := oRibbon:Items():Add("Calendar",3):SubControl() oControl:Width := 256 oControl:Height := 256 oControl:ControlID := "Exontrol.Calendar" oControl:Create() oRibbon:Refresh() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN