RadDock, changing Tab and Tab Text color for selected/unselected Tabs

1 Answer 39 Views
Dock Form TitleBar
Carlos
Top achievements
Rank 1
Carlos asked on 10 May 2024, 01:38 PM

I have this to change the tabs colors when selected/unselected 

         {

           .....

            this.radDock1.ActiveWindowChanging += new DockWindowCancelEventHandler(radDock1_ActiveWindowChanging);
            this.radDock1.ActiveWindowChanged += new DockWindowEventHandler(radDock1_ActiveWindowChanged);

         }

        void radDock1_ActiveWindowChanged(object sender, DockWindowEventArgs e)
        {
            SizeAndColorSelectedDocWindowTab(e.DockWindow.TabStripItem, Color.LightBlue, Color.CornflowerBlue);
        }

        void radDock1_ActiveWindowChanging(object sender, DockWindowCancelEventArgs e)
        {
            SizeAndColorUnSelectedDocWindowTab(e.OldWindow.TabStripItem, Color.CornflowerBlue, Color.DarkBlue);
        }

 

But how can I change the color of the Tab title? when unselected the text almost disappears, I would like to change to a whiter color

 

Also, this works when the children are Tabbed, how can I implement something similar on titlebar when DockPosition.Left  (or anything else than tabbed) ?

1 Answer, 1 is accepted

Sort by
0
Nadya | Tech Support Engineer
Telerik team
answered on 15 May 2024, 10:50 AM

Hello, Carlos,

In order to manage the color of selected/unselected tabs you should use the CaptionElement and specify its ForeColor proerty. The following code snippet demonstrates how to set the  ForeColor when select a new dock window:

void radDock1_ActiveWindowChanged(object sender, DockWindowEventArgs e)
{
    (e.DockWindow.TabStrip as ToolTabStrip).CaptionElement.ForeColor = Color.Green;
}
// TO DO 

You should do similar when unselect a window.

I hope this helps. If you have any other questions please let me know.

Regards,
Nadya | Tech Support Engineer
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Carlos
Top achievements
Rank 1
commented on 16 May 2024, 06:42 PM

I'm getting "object reference not set to an instance of an object"

Telerik version 4.0.30319

(e.DockWindow.TabStrip as ToolTabStrip)  is null

 

 

Carlos
Top achievements
Rank 1
commented on 16 May 2024, 07:23 PM

I just found that the correct property to check in my case was

e.DockWindow.TabStripItem.Forecolor

and

e.OldWindow.TabStripItem.Forecolor

 

Thank you

Nadya | Tech Support Engineer
Telerik team
commented on 17 May 2024, 02:42 PM

Hello, Carlos,

This is also a possible solution. Feel free to use TabStripItem.Forecolor property for your case. 

If you have any other questions do not hesitate to contact us.

Tags
Dock Form TitleBar
Asked by
Carlos
Top achievements
Rank 1
Answers by
Nadya | Tech Support Engineer
Telerik team
Share this question
or