Type | Description | |||
Variant | A VARIANT expression that specifies the edit's value. |
The EditValue property indicates the edit's value as shown bellow:
How can I assign a color field to the item (method 2)?
VBA (MS Access, Excell...)
With Ribbon1 With .Items With .Add("Color") .AllowEdit = 6 .EditBorder = 0 .EditWidth = -128 .EditValue = 255 End With End With .Refresh End With
VB6
With Ribbon1 With .Items With .Add("Color") .AllowEdit = exItemEditColor .EditBorder = exEditBorderNone .EditWidth = -128 .EditValue = 255 End With End With .Refresh End With
VB.NET
With Exribbon1 With .Items With .Add("Color") .AllowEdit = exontrol.EXRIBBONLib.AllowEditEnum.exItemEditColor .EditBorder = exontrol.EXRIBBONLib.EditBorderEnum.exEditBorderNone .EditWidth = -128 .EditValue = 255 End With End With .Refresh() End With
VB.NET for /COM
With AxRibbon1 With .Items With .Add("Color") .AllowEdit = EXRIBBONLib.AllowEditEnum.exItemEditColor .EditBorder = EXRIBBONLib.EditBorderEnum.exEditBorderNone .EditWidth = -128 .EditValue = 255 End With 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(); EXRIBBONLib::IItemPtr var_Item = var_Items->Add(L"Color",vtMissing,vtMissing); var_Item->PutAllowEdit(EXRIBBONLib::exItemEditColor); var_Item->PutEditBorder(EXRIBBONLib::exEditBorderNone); var_Item->PutEditWidth(-128); var_Item->PutEditValue(long(255)); spRibbon1->Refresh();
C++ Builder
Exribbonlib_tlb::IItemsPtr var_Items = Ribbon1->Items; Exribbonlib_tlb::IItemPtr var_Item = var_Items->Add(L"Color",TNoParam(),TNoParam()); var_Item->AllowEdit = Exribbonlib_tlb::AllowEditEnum::exItemEditColor; var_Item->EditBorder = Exribbonlib_tlb::EditBorderEnum::exEditBorderNone; var_Item->EditWidth = -128; var_Item->set_EditValue(TVariant(255)); Ribbon1->Refresh();
C#
exontrol.EXRIBBONLib.Items var_Items = exribbon1.Items; exontrol.EXRIBBONLib.Item var_Item = var_Items.Add("Color",null,null); var_Item.AllowEdit = exontrol.EXRIBBONLib.AllowEditEnum.exItemEditColor; var_Item.EditBorder = exontrol.EXRIBBONLib.EditBorderEnum.exEditBorderNone; var_Item.EditWidth = -128; var_Item.EditValue = 255; 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 var_Item = var_Items.Add("Color",null,null); var_Item.AllowEdit = 6; var_Item.EditBorder = 0; var_Item.EditWidth = -128; var_Item.EditValue = 255; 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 With .Add("Color") .AllowEdit = 6 .EditBorder = 0 .EditWidth = -128 .EditValue = 255 End With End With .Refresh End With End Function </SCRIPT> </BODY>
C# for /COM
EXRIBBONLib.Items var_Items = axRibbon1.Items; EXRIBBONLib.Item var_Item = var_Items.Add("Color",null,null); var_Item.AllowEdit = EXRIBBONLib.AllowEditEnum.exItemEditColor; var_Item.EditBorder = EXRIBBONLib.EditBorderEnum.exEditBorderNone; var_Item.EditWidth = -128; var_Item.EditValue = 255; axRibbon1.Refresh();
X++ (Dynamics Ax 2009)
public void init() { COM com_Item,com_Items; anytype var_Item,var_Items; ; super(); var_Items = exribbon1.Items(); com_Items = var_Items; var_Item = com_Items.Add("Color"); com_Item = var_Item; com_Item.AllowEdit(6/*exItemEditColor*/); com_Item.EditBorder(0/*exEditBorderNone*/); com_Item.EditWidth(-128); com_Item.EditValue(COMVariant::createFromInt(255)); exribbon1.Refresh(); }
Delphi 8 (.NET only)
with AxRibbon1 do begin with Items do begin with Add('Color',Nil,Nil) do begin AllowEdit := EXRIBBONLib.AllowEditEnum.exItemEditColor; EditBorder := EXRIBBONLib.EditBorderEnum.exEditBorderNone; EditWidth := -128; EditValue := TObject(255); end; end; Refresh(); end
Delphi (standard)
with Ribbon1 do begin with Items do begin with Add('Color',Null,Null) do begin AllowEdit := EXRIBBONLib_TLB.exItemEditColor; EditBorder := EXRIBBONLib_TLB.exEditBorderNone; EditWidth := -128; EditValue := OleVariant(255); end; end; Refresh(); end
VFP
with thisform.Ribbon1 with .Items with .Add("Color") .AllowEdit = 6 .EditBorder = 0 .EditWidth = -128 .EditValue = 255 endwith endwith .Refresh endwith
dBASE Plus
local oRibbon,var_Item,var_Items oRibbon = form.Activex1.nativeObject var_Items = oRibbon.Items var_Item = var_Items.Add("Color") var_Item.AllowEdit = 6 var_Item.EditBorder = 0 var_Item.EditWidth = -128 var_Item.EditValue = 255 oRibbon.Refresh()
XBasic (Alpha Five)
Dim oRibbon as P Dim var_Item as P Dim var_Items as P oRibbon = topparent:CONTROL_ACTIVEX1.activex var_Items = oRibbon.Items var_Item = var_Items.Add("Color") var_Item.AllowEdit = 6 var_Item.EditBorder = 0 var_Item.EditWidth = -128 var_Item.EditValue = 255 oRibbon.Refresh()
Visual Objects
local var_Item as IItem local var_Items as IItems var_Items := oDCOCX_Exontrol1:Items var_Item := var_Items:Add("Color",nil,nil) var_Item:AllowEdit := exItemEditColor var_Item:EditBorder := exEditBorderNone var_Item:EditWidth := -128 var_Item:EditValue := 255 oDCOCX_Exontrol1:Refresh()
PowerBuilder
OleObject oRibbon,var_Item,var_Items oRibbon = ole_1.Object var_Items = oRibbon.Items var_Item = var_Items.Add("Color") var_Item.AllowEdit = 6 var_Item.EditBorder = 0 var_Item.EditWidth = -128 var_Item.EditValue = 255 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 "Color" Nothing Nothing to voItem Handle hoItem Get Create (RefClass(cComItem)) to hoItem Set pvComObject of hoItem to voItem Set ComAllowEdit of hoItem to OLEexItemEditColor Set ComEditBorder of hoItem to OLEexEditBorderNone Set ComEditWidth of hoItem to -128 Set ComEditValue of hoItem to 255 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 oItem 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() oItem := oItems:Add("Color") oItem:AllowEdit := 6/*exItemEditColor*/ oItem:EditBorder := 0/*exEditBorderNone*/ oItem:EditWidth := -128 oItem:EditValue := 255 oRibbon:Refresh() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN