radGroupBox Header text color

4 posts, 0 answers
  1. Steven Randlett
    Steven Randlett avatar
    7 posts
    Member since:
    Sep 2009

    Posted 06 May 2011 Link to this post

    I am a bit confused here.  What I want to do is change the color of the text in the header of a group box.  Here's what I have figured out so far:

    Dim

     

     

    RE As RadElement = DirectCast(Me.rgbPharmacyInformation.RootElement.Children(0).Children(1).
                                                                        Children(2).Children(1),
    RadElement)
    The zeroth child of the root element is the RadGroupBoxElement.
    The First child of the RadGroupBoxElement is the GroupBoxHeader element.
    The second child of the GroupBoxHesder elelemnt is the ImageAndTextLayoutPanel element.
    The first child of the ImageAndTextLayoutPanel element is text. 

    Looking at the property inspector in VS2010, I see properties for this element and the property I would like to change is the Fioreground color.  But what do I cast the "text" element as (In the above code, the "text" can be successfully cast to a RadElement)?  How can I get to this property?   

    Anybody's assistance would be appreciated!  Thank you for your time!

     

  2. Stefan
    Admin
    Stefan avatar
    2906 posts

    Posted 10 May 2011 Link to this post

    Hi Steven,

    Thank you for writing.

    You can change the color of the header text in RadGroupBox by modifying the ForeColor property of the Header element. Here is how you can access it:
    radGroupBox1.GroupBoxElement.Header.ForeColor = Color.Red;

    I hope the provided information addresses your question. Should you have any other questions, do not hesitate to contact us.
     
    Regards,
    Stefan
    the Telerik team
    Q1’11 SP1 of RadControls for WinForms is available for download; also available is the Q2'11 Roadmap for Telerik Windows Forms controls.
  3. Dave
    Dave avatar
    14 posts
    Member since:
    Jan 2005

    Posted 11 Oct Link to this post

    Can anyone explain why

    radGroupBox1.GroupBoxElement.Header.BackColor = Color.Green;

    ...does not have the intended effect of turning the group box's label background green?

  4. Dess
    Admin
    Dess avatar
    2164 posts

    Posted 12 Oct Link to this post

    Hello, Dave,  

    Thank you for writing.  

    In order to change the back color for the header text in RadGroupBox, it is necessary to set the GroupBoxElement.Header.Fill.BackColor property: 
    radGroupBox1.GroupBoxElement.Header.Fill.BackColor = Color.Green;

    I hope this information helps. Should you have further questions I would be glad to help.

    Regards,
    Dess
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top