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

How to set a fill primitive programataically

3 Answers 171 Views
Dock
This is a migrated thread and some comments may be shown as answers.
RTA
Top achievements
Rank 1
RTA asked on 22 Apr 2016, 08:25 PM

Hello, 

I need to set the fill primitive of a control programatically.  Attached is a picture of what I need to accomplish. 

From the tree on the left (of the attached image) you can see I'm setting DockLayoutPanel.ToolwindowCaptionElement.FillPrimitive to the color red.  Works great from within the designer, but I need to do it via program control.  

 

It seems like this control, which is in a raddock, is part of a tool tab strip so I've tried...

 toolTabStrip11.SplitPanelElement.Fill.BackColor = Color.Red;

toolTabStrip11.SplitPanelElement.ForeColor = Color.Red;

and several other variations, but none of them changed the color.   Is there a way to do this grammatically? 

 

Thanks to anyone who can solve this, 

Steve

3 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 25 Apr 2016, 09:46 AM
Hi Steve,

Thank you for writing.

As far as I can determine from the attached image you want to access the fill of tool window caption. This can be achieved like this:
var strip = (ToolTabStrip)toolWindow1.TabStrip;
var fill = strip.CaptionElement.Children[0] as FillPrimitive;
fill.BackColor = Color.Red;

Let me know if I can assist you further.

Regards,
Dimitar
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
RTA
Top achievements
Rank 1
answered on 25 Apr 2016, 04:35 PM

What type is FillPrimitive?   It's not coming up via Intellisense and I can't seem to find the class its part of. 

0
Accepted
Dimitar
Telerik team
answered on 26 Apr 2016, 09:35 AM
Hello Steve,

Thank you for writing back.

You need to include the following namespace:
using Telerik.WinControls.Primitives;

Detailed information about the primitives is available in the following articles:
I hope this will be useful. 

Regards,
Dimitar
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
Dock
Asked by
RTA
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
RTA
Top achievements
Rank 1
Share this question
or