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

radGroupBox Header text color

3 Answers 419 Views
GroupBox
This is a migrated thread and some comments may be shown as answers.
Steven Randlett
Top achievements
Rank 1
Steven Randlett asked on 06 May 2011, 08:20 PM
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!

 

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 10 May 2011, 04:55 PM
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.
0
Dave
Top achievements
Rank 1
answered on 11 Oct 2017, 05:43 PM

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?

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 12 Oct 2017, 08:49 AM
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.
Tags
GroupBox
Asked by
Steven Randlett
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Dave
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or