Type | Description | |||
AlignmentEnum | An AlignmentEnum expression that specifies the item's |
How do I align the item?
VBA (MS Access, Excell...)
With Ribbon1 With .Items .BackColor = RGB(250,250,250) .Add "Item" With .Add("Item") .Alignment = 1 .CaptionWidth = 128 End With With .Add("Item") .Alignment = 2 .CaptionWidth = 128 End With .Add("").ToString = "Item[align=1]" End With .Refresh End With
VB6
With Ribbon1 With .Items .BackColor = RGB(250,250,250) .Add "Item" With .Add("Item") .Alignment = exCenter .CaptionWidth = 128 End With With .Add("Item") .Alignment = exRight .CaptionWidth = 128 End With .Add("").ToString = "Item[align=1]" End With .Refresh End With
VB.NET
With Exribbon1 With .Items .BackColor = Color.FromArgb(250,250,250) .Add("Item") With .Add("Item") .Alignment = exontrol.EXRIBBONLib.AlignmentEnum.exCenter .CaptionWidth = 128 End With With .Add("Item") .Alignment = exontrol.EXRIBBONLib.AlignmentEnum.exRight .CaptionWidth = 128 End With .Add("").ToString = "Item[align=1]" End With .Refresh() End With
VB.NET for /COM
With AxRibbon1 With .Items .BackColor = RGB(250,250,250) .Add("Item") With .Add("Item") .Alignment = EXRIBBONLib.AlignmentEnum.exCenter .CaptionWidth = 128 End With With .Add("Item") .Alignment = EXRIBBONLib.AlignmentEnum.exRight .CaptionWidth = 128 End With .Add("").ToString = "Item[align=1]" 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::IItemsPtr var_Items = spRibbon1->GetItems(); var_Items->PutBackColor(RGB(250,250,250)); var_Items->Add(L"Item",vtMissing,vtMissing); EXRIBBONLib::IItemPtr var_Item = var_Items->Add(L"Item",vtMissing,vtMissing); var_Item->PutAlignment(EXRIBBONLib::exCenter); var_Item->PutCaptionWidth(128); EXRIBBONLib::IItemPtr var_Item1 = var_Items->Add(L"Item",vtMissing,vtMissing); var_Item1->PutAlignment(EXRIBBONLib::exRight); var_Item1->PutCaptionWidth(128); var_Items->Add(L"",vtMissing,vtMissing)->PutToString(L"Item[align=1]"); spRibbon1->Refresh();
C++ Builder
Exribbonlib_tlb::IItemsPtr var_Items = Ribbon1->Items; var_Items->BackColor = RGB(250,250,250); var_Items->Add(L"Item",TNoParam(),TNoParam()); Exribbonlib_tlb::IItemPtr var_Item = var_Items->Add(L"Item",TNoParam(),TNoParam()); var_Item->Alignment = Exribbonlib_tlb::AlignmentEnum::exCenter; var_Item->CaptionWidth = 128; Exribbonlib_tlb::IItemPtr var_Item1 = var_Items->Add(L"Item",TNoParam(),TNoParam()); var_Item1->Alignment = Exribbonlib_tlb::AlignmentEnum::exRight; var_Item1->CaptionWidth = 128; var_Items->Add(L"",TNoParam(),TNoParam())->ToString = L"Item[align=1]"; Ribbon1->Refresh();
C#
exontrol.EXRIBBONLib.Items var_Items = exribbon1.Items; var_Items.BackColor = Color.FromArgb(250,250,250); var_Items.Add("Item",null,null); exontrol.EXRIBBONLib.Item var_Item = var_Items.Add("Item",null,null); var_Item.Alignment = exontrol.EXRIBBONLib.AlignmentEnum.exCenter; var_Item.CaptionWidth = 128; exontrol.EXRIBBONLib.Item var_Item1 = var_Items.Add("Item",null,null); var_Item1.Alignment = exontrol.EXRIBBONLib.AlignmentEnum.exRight; var_Item1.CaptionWidth = 128; var_Items.Add("",null,null).ToString = "Item[align=1]"; 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_Items = Ribbon1.Items; var_Items.BackColor = 16448250; var_Items.Add("Item",null,null); var var_Item = var_Items.Add("Item",null,null); var_Item.Alignment = 1; var_Item.CaptionWidth = 128; var var_Item1 = var_Items.Add("Item",null,null); var_Item1.Alignment = 2; var_Item1.CaptionWidth = 128; var_Items.Add("",null,null).ToString = "Item[align=1]"; 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 .BackColor = RGB(250,250,250) .Add "Item" With .Add("Item") .Alignment = 1 .CaptionWidth = 128 End With With .Add("Item") .Alignment = 2 .CaptionWidth = 128 End With .Add("").ToString = "Item[align=1]" End With .Refresh End With End Function </SCRIPT> </BODY>
C# for /COM
EXRIBBONLib.Items var_Items = axRibbon1.Items; var_Items.BackColor = (uint)ColorTranslator.ToWin32(Color.FromArgb(250,250,250)); var_Items.Add("Item",null,null); EXRIBBONLib.Item var_Item = var_Items.Add("Item",null,null); var_Item.Alignment = EXRIBBONLib.AlignmentEnum.exCenter; var_Item.CaptionWidth = 128; EXRIBBONLib.Item var_Item1 = var_Items.Add("Item",null,null); var_Item1.Alignment = EXRIBBONLib.AlignmentEnum.exRight; var_Item1.CaptionWidth = 128; var_Items.Add("",null,null).ToString = "Item[align=1]"; axRibbon1.Refresh();
X++ (Dynamics Ax 2009)
public void init() { COM com_Item,com_Item1,com_Item2,com_Items; anytype var_Item,var_Item1,var_Item2,var_Items; ; super(); var_Items = exribbon1.Items(); com_Items = var_Items; com_Items.BackColor(WinApi::RGB2int(250,250,250)); com_Items.Add("Item"); var_Item = com_Items.Add("Item"); com_Item = var_Item; com_Item.Alignment(1/*exCenter*/); com_Item.CaptionWidth(128); var_Item1 = com_Items.Add("Item"); com_Item1 = var_Item1; com_Item1.Alignment(2/*exRight*/); com_Item1.CaptionWidth(128); var_Item2 = COM::createFromObject(com_Items.Add("")); com_Item2 = var_Item2; com_Item2.ToString("Item[align=1]"); exribbon1.Refresh(); }
Delphi 8 (.NET only)
with AxRibbon1 do begin with Items do begin BackColor := $fafafa; Add('Item',Nil,Nil); with Add('Item',Nil,Nil) do begin Alignment := EXRIBBONLib.AlignmentEnum.exCenter; CaptionWidth := 128; end; with Add('Item',Nil,Nil) do begin Alignment := EXRIBBONLib.AlignmentEnum.exRight; CaptionWidth := 128; end; Add('',Nil,Nil).ToString := 'Item[align=1]'; end; Refresh(); end
Delphi (standard)
with Ribbon1 do begin with Items do begin BackColor := $fafafa; Add('Item',Null,Null); with Add('Item',Null,Null) do begin Alignment := EXRIBBONLib_TLB.exCenter; CaptionWidth := 128; end; with Add('Item',Null,Null) do begin Alignment := EXRIBBONLib_TLB.exRight; CaptionWidth := 128; end; Add('',Null,Null).ToString := 'Item[align=1]'; end; Refresh(); end
VFP
with thisform.Ribbon1 with .Items .BackColor = RGB(250,250,250) .Add("Item") with .Add("Item") .Alignment = 1 .CaptionWidth = 128 endwith with .Add("Item") .Alignment = 2 .CaptionWidth = 128 endwith .Add("").ToString = "Item[align=1]" endwith .Refresh endwith
dBASE Plus
local oRibbon,var_Item,var_Item1,var_Item2,var_Items oRibbon = form.Activex1.nativeObject var_Items = oRibbon.Items var_Items.BackColor = 0xfafafa var_Items.Add("Item") var_Item = var_Items.Add("Item") var_Item.Alignment = 1 var_Item.CaptionWidth = 128 var_Item1 = var_Items.Add("Item") var_Item1.Alignment = 2 var_Item1.CaptionWidth = 128 // var_Items.Add("").ToString = "Item[align=1]" var_Item2 = var_Items.Add("") with (oRibbon) TemplateDef = [Dim var_Item2] TemplateDef = var_Item2 Template = [var_Item2.ToString = "Item[align=1]"] endwith oRibbon.Refresh()
XBasic (Alpha Five)
Dim oRibbon as P Dim var_Item as P Dim var_Item1 as P Dim var_Item2 as P Dim var_Items as P oRibbon = topparent:CONTROL_ACTIVEX1.activex var_Items = oRibbon.Items var_Items.BackColor = 16448250 var_Items.Add("Item") var_Item = var_Items.Add("Item") var_Item.Alignment = 1 var_Item.CaptionWidth = 128 var_Item1 = var_Items.Add("Item") var_Item1.Alignment = 2 var_Item1.CaptionWidth = 128 ' var_Items.Add("").ToString = "Item[align=1]" var_Item2 = var_Items.Add("") oRibbon.TemplateDef = "Dim var_Item2" oRibbon.TemplateDef = var_Item2 oRibbon.Template = "var_Item2.ToString = \"Item[align=1]\"" oRibbon.Refresh()
Visual Objects
local var_Item,var_Item1 as IItem local var_Items as IItems var_Items := oDCOCX_Exontrol1:Items var_Items:BackColor := RGB(250,250,250) var_Items:Add("Item",nil,nil) var_Item := var_Items:Add("Item",nil,nil) var_Item:Alignment := exCenter var_Item:CaptionWidth := 128 var_Item1 := var_Items:Add("Item",nil,nil) var_Item1:Alignment := exRight var_Item1:CaptionWidth := 128 var_Items:Add("",nil,nil):ToString := "Item[align=1]" oDCOCX_Exontrol1:Refresh()
PowerBuilder
OleObject oRibbon,var_Item,var_Item1,var_Items oRibbon = ole_1.Object var_Items = oRibbon.Items var_Items.BackColor = RGB(250,250,250) var_Items.Add("Item") var_Item = var_Items.Add("Item") var_Item.Alignment = 1 var_Item.CaptionWidth = 128 var_Item1 = var_Items.Add("Item") var_Item1.Alignment = 2 var_Item1.CaptionWidth = 128 var_Items.Add("").ToString = "Item[align=1]" 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 Set ComBackColor of hoItems to (RGB(250,250,250)) Get ComAdd of hoItems "Item" Nothing Nothing to Nothing Variant voItem Get ComAdd of hoItems "Item" Nothing Nothing to voItem Handle hoItem Get Create (RefClass(cComItem)) to hoItem Set pvComObject of hoItem to voItem Set ComAlignment of hoItem to OLEexCenter Set ComCaptionWidth of hoItem to 128 Send Destroy to hoItem Variant voItem1 Get ComAdd of hoItems "Item" Nothing Nothing to voItem1 Handle hoItem1 Get Create (RefClass(cComItem)) to hoItem1 Set pvComObject of hoItem1 to voItem1 Set ComAlignment of hoItem1 to OLEexRight Set ComCaptionWidth of hoItem1 to 128 Send Destroy to hoItem1 Variant voItem2 Get ComAdd of hoItems "" Nothing Nothing to voItem2 Handle hoItem2 Get Create (RefClass(cComItem)) to hoItem2 Set pvComObject of hoItem2 to voItem2 Set ComToString of hoItem2 to "Item[align=1]" Send Destroy to hoItem2 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 oItem,oItem1 LOCAL oItems 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} ) oItems := oRibbon:Items() oItems:SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor ( { 250,250,250 } ) , .F. )) oItems:Add("Item") oItem := oItems:Add("Item") oItem:Alignment := 1/*exCenter*/ oItem:CaptionWidth := 128 oItem1 := oItems:Add("Item") oItem1:Alignment := 2/*exRight*/ oItem1:CaptionWidth := 128 oItems:Add(""):ToString := "Item[align=1]" oRibbon:Refresh() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN