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
    Dimitar avatar
    2566 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.

    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. 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