How to set a fill primitive programataically

4 posts, 1 answers
  1. Steve
    Steve avatar
    11 posts
    Member since:
    Jul 2012

    Posted 22 Apr Link to this post

    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

  2. Dimitar
    Admin
    Dimitar avatar
    1405 posts

    Posted 25 Apr Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Steve
    Steve avatar
    11 posts
    Member since:
    Jul 2012

    Posted 25 Apr in reply to Dimitar Link to this post

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

  5. Answer
    Dimitar
    Admin
    Dimitar avatar
    1405 posts

    Posted 26 Apr Link to this post

    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.
Back to Top