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

How to set BackColor of ToolStripStatusLabel in custom theme?

1 Answer 493 Views
Themes and Visual Style Builder
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 07 Jan 2013, 06:52 PM
I have a custom theme (.tssp file) that is an exact copy of the built-in Windows7 theme.  I have a RadForm with a StatusStrip.  The StatusStrip contains a ToolStripStatusLabel.  I need to change the default BackColor of the ToolStripStatusLabel in VisualStyleBuilder but I cannot figure out how to do it.

Please help!

Thanks

1 Answer, 1 is accepted

Sort by
0
Anton
Telerik team
answered on 10 Jan 2013, 02:04 PM
Hello Mark,

Thank you for writing.

Currently, you cannot change the back color of the labels inside the RadStatusStrip through the theme. By default they are transparent so they will take their parents' color. However, you can achieve the desired behavior very easy with code. For example:
ThemeResolutionService.LoadPackageFile(@"C:\Windows7.tssp");
ThemeResolutionService.ApplicationThemeName = "Windows7";
 
foreach (RadElement item in this.radStatusStrip1.StatusBarElement.Items)
{
    if (item is RadLabelElement)
    {
        RadLabelElement label = item as RadLabelElement;
 
        label.LabelFill.BackColor = Color.Red;
        label.LabelFill.BackColor2 = Color.Red;
        label.LabelFill.BackColor3 = Color.Red;
        label.LabelFill.BackColor4 = Color.Red;
    }
}

Should you have any other questions, I will be glad to assist you.

Greetings,
Anton
the Telerik team
Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
Tags
Themes and Visual Style Builder
Asked by
Mark
Top achievements
Rank 1
Answers by
Anton
Telerik team
Share this question
or