0

Im trying to change the background color of Ribbon Control Pages and Groups but i dont know how can i do it.

I have this:

Public Shared Sub addPage(ByRef ribboncontrol As RibbonControl, ByVal titulo As String, ByVal color As String)                             
    ribboncontrol.Pages.Add(New RibbonPage(titulo))
End Sub


Public Shared Sub addGroup(ByRef ribboncontrol As RibbonControl, ByVal titulo As String, ByVal pagina As String, ByVal color As String)                 
    ribboncontrol.Pages.GetPageByText(pagina).Groups.Add(New RibbonPageGroup(titulo))
End Sub

I want that the color parameter change the color of RibbonPage and RibbonPageGroup dinamically, with vb.net code

I ve seen a lot of examples with C# but i need to do it with visual basic.

  • Can you show to us examples with c#? – nempoBu4 Jul 02 '14 at 06:28
  • http://www.devexpress.com/Support/Center/Question/Details/Q483554 – Brian Miranda Jul 02 '14 at 17:29
  • @BrianMiranda From your code snippet I see that your question is about WinForms Ribbon. Am I correct? If so, how can the [link](http://www.devexpress.com/Support/Center/Question/Details/Q483554), related to WPF Ribbon control, make a sense in the context of this question? If your question is really about the WPF Ribbon - the answer is: "No you can't change backcolor directly from code because of it should be done via WPF styles/templates". – DmitryG Jul 02 '14 at 19:12
  • Im using DevExpress RibbonControl component ver 14.1.3.0, This component is in a Visual Studio 2010 Form and im programming in Visual Studio. The link is only an example – Brian Miranda Jul 02 '14 at 22:55

1 Answers1

0

You can't change back color of RibbonPage and RibbonPageGroup directly, because their painting depends on current skin (see DevExpress Skinning Technology).
But if you are using categories for pages, you can use the RibbonPageCategory.Color property to specify the color that is used to paint the category's caption and its pages. This color is mixed with the background color of the RibbonForm's title bar, captions and client areas of Ribbon pages.

DmitryG
  • 17,677
  • 1
  • 30
  • 53
  • Im not using RibbonPageCategory but i ve seen BarManager can help me. do you know how to do it? – Brian Miranda Jul 02 '14 at 17:33
  • You can't use the BarManager component and the Ribbon control together because these components provides different types of UI (Ribbons/Bars). And moreover Ribbon UI concepts allows Page/PageGroup colorization only in the context of Page Categories feature. – DmitryG Jul 02 '14 at 19:09
  • Do you have an example using skins? – Brian Miranda Jul 02 '14 at 23:15
  • Skins are already active by default for all WinForms controls. You can start from reading [Skins Overview](https://documentation.devexpress.com/#WindowsForms/CustomDocument2534) - this help-article is demonstrated how to apply specific skins and etc. – DmitryG Jul 03 '14 at 08:37