Change Title Bar background color on RadRibbonForm

3 posts, 0 answers
  1. Chris
    Chris avatar
    5 posts
    Member since:
    Jan 2013

    Posted 21 Nov 2013 Link to this post

    I am using a RadRibbonForm control, so I hope this is the correct forum. 

    Could you give me the lines of code to change the background color of the title bar on a RadRibbonForm?

    Why, you ask?  I would like to change the background color of the title bar when the application is in "Test" mode and connected to our test data (vs. production).  I realize this is probably unusual and goes against Microsoft specs for Ribbon Forms, but I want it to be clearly visible to all that the application is connected to test data and not connected to production.  My thought was that all forms in the application (the main RadRibbonForm, and various modal dialogs) would have a highlighted title bar when in test mode.  Regular production users would only see the "normal" view.

    I can easily do this on RadForms like this:

         form.FormElement.TitleBar.FillPrimitive.GradientStyle = Telerik.WinControls.GradientStyles.Solid;

        form.FormElement.TitleBar.FillPrimitive.BackColor = Color.Yellow;

    But I can't find the right property for the RadRibbonForm. I've tried with no avail things like:

         this.radRibbonBarMain.RibbonBarElement.RibbonCaption.BackColor = Color.Yellow;

    Could you help me out?

  2. Dimitar
    Admin
    Dimitar avatar
    1404 posts

    Posted 25 Nov 2013 Link to this post

    Hi Chris,

    Thank you for contacting us.

    In order to be able to style the title bar first you should set the AllowAero property to false. Then you can set  any desired styles of the title bar. For example you can set the backcolor like this:
    this.AllowAero = false;
    radRibbonBar1.RibbonBarElement.CaptionFill.BackColor = Color.Yellow;
    radRibbonBar1.RibbonBarElement.CaptionFill.NumberOfColors = 1;

    I hope this helps. Should you have any other questions do not hesitate to ask.

    Regards,
    Dimitar
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Chris
    Chris avatar
    5 posts
    Member since:
    Jan 2013

    Posted 25 Nov 2013 Link to this post

    That works! Thanks so much!
Back to Top