简体   繁体   中英

Code to change background color RibbonControl vb.net

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM