This is a migrated thread and some comments may be shown as answers.

Change Title Bar background color on RadRibbonForm

2 Answers 448 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 21 Nov 2013, 06:41 PM

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 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 25 Nov 2013, 04:06 PM
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 >>
0
Chris
Top achievements
Rank 1
answered on 25 Nov 2013, 05:57 PM
That works! Thanks so much!
Tags
RibbonBar
Asked by
Chris
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Chris
Top achievements
Rank 1
Share this question
or