Type | Description | |||
Part as BackgroundPartEnum | A BackgroundPartEnum expression that indicates the part to be changed | |||
Color | A Color expression that indicates the background color for a specified part. The last 7 bits in the high significant byte of the color to indicates the identifier of the skin being used. Use the Add method to add new skins to the control. If you need to remove the skin appearance from a part of the control you need to reset the last 7 bits in the high significant byte of the color being applied to the background's part. |
The following screen shot shows the check-boxes, as they are shown by default:
The following screen shot shows the check-boxes, as once a new visual appearance is applied:
How can I change the visual appearance of the check-boxes to be displayed in the ribbon control (ebn)?
VBA (MS Access, Excell...)
With Ribbon1 With .VisualAppearance .Add 1,"c:\exontrol\images\normal.ebn" .Add 2,"c:\exontrol\images\pushed.ebn" End With .Background(70) = &H1000000 .Background(71) = &H2000000 With .Items With .Add("",2) .GroupPopup = 3 ' GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup With .Items With .Add("Check 1") .Check = True .Checked = True End With .Add("Check 2").Check = True End With End With End With .Refresh End With
VB6
With Ribbon1 With .VisualAppearance .Add 1,"c:\exontrol\images\normal.ebn" .Add 2,"c:\exontrol\images\pushed.ebn" End With .Background(exCheckBoxState0) = &H1000000 .Background(exCheckBoxState1) = &H2000000 With .Items With .Add("",2) .GroupPopup = GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup With .Items With .Add("Check 1") .Check = True .Checked = True End With .Add("Check 2").Check = True End With End With End With .Refresh End With
VB.NET
With Exribbon1 With .VisualAppearance .Add(1,"c:\exontrol\images\normal.ebn") .Add(2,"c:\exontrol\images\pushed.ebn") End With .set_Background32(exontrol.EXRIBBONLib.BackgroundPartEnum.exCheckBoxState0,&H1000000) .set_Background32(exontrol.EXRIBBONLib.BackgroundPartEnum.exCheckBoxState1,&H2000000) With .Items With .Add("",2) .GroupPopup = exontrol.EXRIBBONLib.GroupPopupEnum.exNoGroupPopupFrame Or exontrol.EXRIBBONLib.GroupPopupEnum.exGroupPopup With .Items With .Add("Check 1") .Check = True .Checked = True End With .Add("Check 2").Check = True End With End With End With .Refresh() End With
VB.NET for /COM
With AxRibbon1 With .VisualAppearance .Add(1,"c:\exontrol\images\normal.ebn") .Add(2,"c:\exontrol\images\pushed.ebn") End With .set_Background(EXRIBBONLib.BackgroundPartEnum.exCheckBoxState0,16777216) .set_Background(EXRIBBONLib.BackgroundPartEnum.exCheckBoxState1,33554432) With .Items With .Add("",2) .GroupPopup = EXRIBBONLib.GroupPopupEnum.exNoGroupPopupFrame Or EXRIBBONLib.GroupPopupEnum.exGroupPopup With .Items With .Add("Check 1") .Check = True .Checked = True End With .Add("Check 2").Check = True End With 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::IAppearancePtr var_Appearance = spRibbon1->GetVisualAppearance(); var_Appearance->Add(1,"c:\\exontrol\\images\\normal.ebn"); var_Appearance->Add(2,"c:\\exontrol\\images\\pushed.ebn"); spRibbon1->PutBackground(EXRIBBONLib::exCheckBoxState0,0x1000000); spRibbon1->PutBackground(EXRIBBONLib::exCheckBoxState1,0x2000000); EXRIBBONLib::IItemsPtr var_Items = spRibbon1->GetItems(); EXRIBBONLib::IItemPtr var_Item = var_Items->Add(L"",long(2),vtMissing); var_Item->PutGroupPopup(EXRIBBONLib::GroupPopupEnum(EXRIBBONLib::exNoGroupPopupFrame | EXRIBBONLib::exGroupPopup)); EXRIBBONLib::IItemsPtr var_Items1 = var_Item->GetItems(); EXRIBBONLib::IItemPtr var_Item1 = var_Items1->Add(L"Check 1",vtMissing,vtMissing); var_Item1->PutCheck(VARIANT_TRUE); var_Item1->PutChecked(VARIANT_TRUE); var_Items1->Add(L"Check 2",vtMissing,vtMissing)->PutCheck(VARIANT_TRUE); spRibbon1->Refresh();
C++ Builder
Exribbonlib_tlb::IAppearancePtr var_Appearance = Ribbon1->VisualAppearance; var_Appearance->Add(1,TVariant("c:\\exontrol\\images\\normal.ebn")); var_Appearance->Add(2,TVariant("c:\\exontrol\\images\\pushed.ebn")); Ribbon1->Background[Exribbonlib_tlb::BackgroundPartEnum::exCheckBoxState0] = 0x1000000; Ribbon1->Background[Exribbonlib_tlb::BackgroundPartEnum::exCheckBoxState1] = 0x2000000; Exribbonlib_tlb::IItemsPtr var_Items = Ribbon1->Items; Exribbonlib_tlb::IItemPtr var_Item = var_Items->Add(L"",TVariant(2),TNoParam()); var_Item->GroupPopup = Exribbonlib_tlb::GroupPopupEnum::exNoGroupPopupFrame | Exribbonlib_tlb::GroupPopupEnum::exGroupPopup; Exribbonlib_tlb::IItemsPtr var_Items1 = var_Item->Items; Exribbonlib_tlb::IItemPtr var_Item1 = var_Items1->Add(L"Check 1",TNoParam(),TNoParam()); var_Item1->Check = true; var_Item1->Checked = true; var_Items1->Add(L"Check 2",TNoParam(),TNoParam())->Check = true; Ribbon1->Refresh();
C#
exontrol.EXRIBBONLib.Appearance var_Appearance = exribbon1.VisualAppearance; var_Appearance.Add(1,"c:\\exontrol\\images\\normal.ebn"); var_Appearance.Add(2,"c:\\exontrol\\images\\pushed.ebn"); exribbon1.set_Background32(exontrol.EXRIBBONLib.BackgroundPartEnum.exCheckBoxState0,0x1000000); exribbon1.set_Background32(exontrol.EXRIBBONLib.BackgroundPartEnum.exCheckBoxState1,0x2000000); exontrol.EXRIBBONLib.Items var_Items = exribbon1.Items; exontrol.EXRIBBONLib.Item var_Item = var_Items.Add("",2,null); var_Item.GroupPopup = exontrol.EXRIBBONLib.GroupPopupEnum.exNoGroupPopupFrame | exontrol.EXRIBBONLib.GroupPopupEnum.exGroupPopup; exontrol.EXRIBBONLib.Items var_Items1 = var_Item.Items; exontrol.EXRIBBONLib.Item var_Item1 = var_Items1.Add("Check 1",null,null); var_Item1.Check = true; var_Item1.Checked = true; var_Items1.Add("Check 2",null,null).Check = true; 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_Appearance = Ribbon1.VisualAppearance; var_Appearance.Add(1,"c:\\exontrol\\images\\normal.ebn"); var_Appearance.Add(2,"c:\\exontrol\\images\\pushed.ebn"); Ribbon1.Background(70) = 16777216; Ribbon1.Background(71) = 33554432; var var_Items = Ribbon1.Items; var var_Item = var_Items.Add("",2,null); var_Item.GroupPopup = 3; var var_Items1 = var_Item.Items; var var_Item1 = var_Items1.Add("Check 1",null,null); var_Item1.Check = true; var_Item1.Checked = true; var_Items1.Add("Check 2",null,null).Check = true; 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 .VisualAppearance .Add 1,"c:\exontrol\images\normal.ebn" .Add 2,"c:\exontrol\images\pushed.ebn" End With .Background(70) = &H1000000 .Background(71) = &H2000000 With .Items With .Add("",2) .GroupPopup = 3 ' GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup With .Items With .Add("Check 1") .Check = True .Checked = True End With .Add("Check 2").Check = True End With End With End With .Refresh End With End Function </SCRIPT> </BODY>
C# for /COM
EXRIBBONLib.Appearance var_Appearance = axRibbon1.VisualAppearance; var_Appearance.Add(1,"c:\\exontrol\\images\\normal.ebn"); var_Appearance.Add(2,"c:\\exontrol\\images\\pushed.ebn"); axRibbon1.set_Background(EXRIBBONLib.BackgroundPartEnum.exCheckBoxState0,0x1000000); axRibbon1.set_Background(EXRIBBONLib.BackgroundPartEnum.exCheckBoxState1,0x2000000); EXRIBBONLib.Items var_Items = axRibbon1.Items; EXRIBBONLib.Item var_Item = var_Items.Add("",2,null); var_Item.GroupPopup = EXRIBBONLib.GroupPopupEnum.exNoGroupPopupFrame | EXRIBBONLib.GroupPopupEnum.exGroupPopup; EXRIBBONLib.Items var_Items1 = var_Item.Items; EXRIBBONLib.Item var_Item1 = var_Items1.Add("Check 1",null,null); var_Item1.Check = true; var_Item1.Checked = true; var_Items1.Add("Check 2",null,null).Check = true; axRibbon1.Refresh();
X++ (Dynamics Ax 2009)
public void init() { COM com_Appearance,com_Item,com_Item1,com_Item2,com_Items,com_Items1; anytype var_Appearance,var_Item,var_Item1,var_Item2,var_Items,var_Items1; ; super(); var_Appearance = exribbon1.VisualAppearance(); com_Appearance = var_Appearance; com_Appearance.Add(1,"c:\\exontrol\\images\\normal.ebn"); com_Appearance.Add(2,"c:\\exontrol\\images\\pushed.ebn"); exribbon1.Background(70/*exCheckBoxState0*/,0x1000000); exribbon1.Background(71/*exCheckBoxState1*/,0x2000000); var_Items = exribbon1.Items(); com_Items = var_Items; var_Item = com_Items.Add("",COMVariant::createFromInt(2)); com_Item = var_Item; com_Item.GroupPopup(3/*exNoGroupPopupFrame | exGroupPopup*/); var_Items1 = com_Item.Items(); com_Items1 = var_Items1; var_Item1 = com_Items1.Add("Check 1"); com_Item1 = var_Item1; com_Item1.Check(true); com_Item1.Checked(true); var_Item2 = COM::createFromObject(com_Items1.Add("Check 2")); com_Item2 = var_Item2; com_Item2.Check(true); exribbon1.Refresh(); }
Delphi 8 (.NET only)
with AxRibbon1 do begin with VisualAppearance do begin Add(1,'c:\exontrol\images\normal.ebn'); Add(2,'c:\exontrol\images\pushed.ebn'); end; set_Background(EXRIBBONLib.BackgroundPartEnum.exCheckBoxState0,$1000000); set_Background(EXRIBBONLib.BackgroundPartEnum.exCheckBoxState1,$2000000); with Items do begin with Add('',TObject(2),Nil) do begin GroupPopup := Integer(EXRIBBONLib.GroupPopupEnum.exNoGroupPopupFrame) Or Integer(EXRIBBONLib.GroupPopupEnum.exGroupPopup); with Items do begin with Add('Check 1',Nil,Nil) do begin Check := True; Checked := True; end; Add('Check 2',Nil,Nil).Check := True; end; end; end; Refresh(); end
Delphi (standard)
with Ribbon1 do begin with VisualAppearance do begin Add(1,'c:\exontrol\images\normal.ebn'); Add(2,'c:\exontrol\images\pushed.ebn'); end; Background[EXRIBBONLib_TLB.exCheckBoxState0] := $1000000; Background[EXRIBBONLib_TLB.exCheckBoxState1] := $2000000; with Items do begin with Add('',OleVariant(2),Null) do begin GroupPopup := Integer(EXRIBBONLib_TLB.exNoGroupPopupFrame) Or Integer(EXRIBBONLib_TLB.exGroupPopup); with Items do begin with Add('Check 1',Null,Null) do begin Check := True; Checked := True; end; Add('Check 2',Null,Null).Check := True; end; end; end; Refresh(); end
VFP
with thisform.Ribbon1 with .VisualAppearance .Add(1,"c:\exontrol\images\normal.ebn") .Add(2,"c:\exontrol\images\pushed.ebn") endwith .Object.Background(70) = 0x1000000 .Object.Background(71) = 0x2000000 with .Items with .Add("",2) .GroupPopup = 3 && GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup with .Items with .Add("Check 1") .Check = .T. .Checked = .T. endwith .Add("Check 2").Check = .T. endwith endwith endwith .Refresh endwith
dBASE Plus
local oRibbon,var_Appearance,var_Item,var_Item1,var_Item2,var_Items,var_Items1 oRibbon = form.Activex1.nativeObject var_Appearance = oRibbon.VisualAppearance var_Appearance.Add(1,"c:\exontrol\images\normal.ebn") var_Appearance.Add(2,"c:\exontrol\images\pushed.ebn") oRibbon.Template = [Background(70) = 0x1000000] // oRibbon.Background(70) = 0x1000000 oRibbon.Template = [Background(71) = 0x2000000] // oRibbon.Background(71) = 0x2000000 var_Items = oRibbon.Items var_Item = var_Items.Add("",2) var_Item.GroupPopup = 3 /*exNoGroupPopupFrame | exGroupPopup*/ var_Items1 = var_Item.Items var_Item1 = var_Items1.Add("Check 1") var_Item1.Check = true var_Item1.Checked = true // var_Items1.Add("Check 2").Check = true var_Item2 = var_Items1.Add("Check 2") with (oRibbon) TemplateDef = [Dim var_Item2] TemplateDef = var_Item2 Template = [var_Item2.Check = true] endwith oRibbon.Refresh()
XBasic (Alpha Five)
Dim oRibbon as P Dim var_Appearance as P Dim var_Item as P Dim var_Item1 as P Dim var_Item2 as P Dim var_Items as P Dim var_Items1 as P oRibbon = topparent:CONTROL_ACTIVEX1.activex var_Appearance = oRibbon.VisualAppearance var_Appearance.Add(1,"c:\exontrol\images\normal.ebn") var_Appearance.Add(2,"c:\exontrol\images\pushed.ebn") oRibbon.Template = "Background(70) = 16777216" ' oRibbon.Background(70) = 16777216 oRibbon.Template = "Background(71) = 33554432" ' oRibbon.Background(71) = 33554432 var_Items = oRibbon.Items var_Item = var_Items.Add("",2) var_Item.GroupPopup = 3 'exNoGroupPopupFrame + exGroupPopup var_Items1 = var_Item.Items var_Item1 = var_Items1.Add("Check 1") var_Item1.Check = .t. var_Item1.Checked = .t. ' var_Items1.Add("Check 2").Check = .t. var_Item2 = var_Items1.Add("Check 2") oRibbon.TemplateDef = "Dim var_Item2" oRibbon.TemplateDef = var_Item2 oRibbon.Template = "var_Item2.Check = True" oRibbon.Refresh()
Visual Objects
local var_Appearance as IAppearance local var_Item,var_Item1 as IItem local var_Items,var_Items1 as IItems var_Appearance := oDCOCX_Exontrol1:VisualAppearance var_Appearance:Add(1,"c:\exontrol\images\normal.ebn") var_Appearance:Add(2,"c:\exontrol\images\pushed.ebn") oDCOCX_Exontrol1:[Background,exCheckBoxState0] := 0x1000000 oDCOCX_Exontrol1:[Background,exCheckBoxState1] := 0x2000000 var_Items := oDCOCX_Exontrol1:Items var_Item := var_Items:Add("",2,nil) var_Item:GroupPopup := exNoGroupPopupFrame | exGroupPopup var_Items1 := var_Item:Items var_Item1 := var_Items1:Add("Check 1",nil,nil) var_Item1:Check := true var_Item1:Checked := true var_Items1:Add("Check 2",nil,nil):Check := true oDCOCX_Exontrol1:Refresh()
PowerBuilder
OleObject oRibbon,var_Appearance,var_Item,var_Item1,var_Items,var_Items1 oRibbon = ole_1.Object var_Appearance = oRibbon.VisualAppearance var_Appearance.Add(1,"c:\exontrol\images\normal.ebn") var_Appearance.Add(2,"c:\exontrol\images\pushed.ebn") oRibbon.Background(70,16777216 /*0x1000000*/) oRibbon.Background(71,33554432 /*0x2000000*/) var_Items = oRibbon.Items var_Item = var_Items.Add("",2) var_Item.GroupPopup = 3 /*exNoGroupPopupFrame | exGroupPopup*/ var_Items1 = var_Item.Items var_Item1 = var_Items1.Add("Check 1") var_Item1.Check = true var_Item1.Checked = true var_Items1.Add("Check 2").Check = true oRibbon.Refresh()
Visual DataFlex
Procedure OnCreate Forward Send OnCreate Variant voAppearance Get ComVisualAppearance to voAppearance Handle hoAppearance Get Create (RefClass(cComAppearance)) to hoAppearance Set pvComObject of hoAppearance to voAppearance Get ComAdd of hoAppearance 1 "c:\exontrol\images\normal.ebn" to Nothing Get ComAdd of hoAppearance 2 "c:\exontrol\images\pushed.ebn" to Nothing Send Destroy to hoAppearance Set ComBackground OLEexCheckBoxState0 to |CI$1000000 Set ComBackground OLEexCheckBoxState1 to |CI$2000000 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 "" 2 Nothing to voItem Handle hoItem Get Create (RefClass(cComItem)) to hoItem Set pvComObject of hoItem to voItem Set ComGroupPopup of hoItem to (OLEexNoGroupPopupFrame + OLEexGroupPopup) Variant voItems1 Get ComItems of hoItem to voItems1 Handle hoItems1 Get Create (RefClass(cComItems)) to hoItems1 Set pvComObject of hoItems1 to voItems1 Variant voItem1 Get ComAdd of hoItems1 "Check 1" Nothing Nothing to voItem1 Handle hoItem1 Get Create (RefClass(cComItem)) to hoItem1 Set pvComObject of hoItem1 to voItem1 Set ComCheck of hoItem1 to True Set ComChecked of hoItem1 to True Send Destroy to hoItem1 Variant voItem2 Get ComAdd of hoItems1 "Check 2" Nothing Nothing to voItem2 Handle hoItem2 Get Create (RefClass(cComItem)) to hoItem2 Set pvComObject of hoItem2 to voItem2 Set ComCheck of hoItem2 to True Send Destroy to hoItem2 Send Destroy to hoItems1 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 oAppearance LOCAL oItem,oItem1 LOCAL oItems,oItems1 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} ) oAppearance := oRibbon:VisualAppearance() oAppearance:Add(1,"c:\exontrol\images\normal.ebn") oAppearance:Add(2,"c:\exontrol\images\pushed.ebn") oRibbon:SetProperty("Background",70/*exCheckBoxState0*/,0x1000000) oRibbon:SetProperty("Background",71/*exCheckBoxState1*/,0x2000000) oItems := oRibbon:Items() oItem := oItems:Add("",2) oItem:GroupPopup := 3/*exNoGroupPopupFrame+exGroupPopup*/ oItems1 := oItem:Items() oItem1 := oItems1:Add("Check 1") oItem1:Check := .T. oItem1:Checked := .T. oItems1:Add("Check 2"):Check := .T. oRibbon:Refresh() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN