Change border color of GroupBox header back to default

3 posts, 1 answers
  1. Roberto Wenzel
    Roberto Wenzel avatar
    41 posts
    Member since:
    Sep 2012

    Posted 22 Feb 2011 Link to this post

    Hello,
    I hope that someone can help me with this little issue.
    I would like to change the color of a GroupBox Header back to the applied theme's default color.

    I prgrammatically changed the border color with the following code to red to show an invalid user input (a kind of validation).

    DirectCast
    (.rgrb_CountryOfOrigin.GroupBoxElement.Children(1).Children(1), BorderPrimitive).ForeColor = Color.Red 

    When the input is corrected the color should change back to its default value. Actually I use the desert theme.
    Is there a possibillity to get a default color value for the assigned theme for the chosen control (eg GroupBox)?
    If not, where can I find the theme values like colors etc?
    Any help is appreciated.
    Cheers Roberto
  2. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 22 Feb 2011 Link to this post

    Hello Roberto,

    You can reset any values in the Telerik Presentation Framework by calling the ResetValue method and passing the property that you want to reset. In this case.

    DirectCast(Me.RadGroupBox1.GroupBoxElement.Children(1).Children(1), BorderPrimitive).ResetValue(LightVisualElement.ForeColorProperty, Telerik.WinControls.ValueResetFlags.Local)

    Hope you find that helpful
    Richard
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Roberto Wenzel
    Roberto Wenzel avatar
    41 posts
    Member since:
    Sep 2012

    Posted 23 Feb 2011 Link to this post

    Cool!
    Thank you Richard. That is what I need.
    Roberto
Back to Top