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

Change color Active tab in TabbedForm

1 Answer 467 Views
TabbedForm
This is a migrated thread and some comments may be shown as answers.
Serg
Top achievements
Rank 1
Veteran
Serg asked on 24 Jul 2020, 08:45 AM

I made the following code to implement this:

e.SelectedTabChanged += (obj, ev) =>
            {
                foreach(RadTabbedFormControlTab tab in e.Tabs)
                {
                    tab.Item.BackColor = Color.FromArgb(0, 255, 255, 255);
                    tab.Item.BorderColor = Color.FromArgb(0, 255, 255, 255);
                    tab.Item.ShadowColor = Color.FromArgb(0, 255, 255, 255);
                }
                e.SelectedTab.Item.BackColor = Color.White;
                e.SelectedTab.Item.BorderColor = Color.White;
                e.SelectedTab.Item.ShadowColor = Color.White;
            };

 

It is right? Or is there another way to change the colors of the tabs when they become active?

1 Answer, 1 is accepted

Sort by
0
Nadya | Tech Support Engineer
Telerik team
answered on 28 Jul 2020, 01:31 PM

Hello, Serg,

According to the provided code snippet, it is not clear which is the event that you handle to color the tabs. It seems that you would like to change the color of the selected/active tab in RadTabbedForm. If you do so, I can suggest overriding the theme settings at run time by using the SetThemeValueOverride method and override the "Selected" state. 

foreach (RadTabbedFormControlTab tab in radTabbedFormControl1.Tabs)
{
    tab.Item.SetThemeValueOverride(LightVisualElement.BackColorProperty, Color.Green, "Selected");
}

More information you can find here: https://docs.telerik.com/devtools/winforms/telerik-presentation-framework/override-theme-settings-at-run-time

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

Regards,
Nadya
Progress Telerik

Tags
TabbedForm
Asked by
Serg
Top achievements
Rank 1
Veteran
Answers by
Nadya | Tech Support Engineer
Telerik team
Share this question
or