Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Panels, Labels, GroupBox > RadGroupBox BackColor from Form insead of RadPage

Not answered RadGroupBox BackColor from Form insead of RadPage

Feed from this thread
  • Posted on Jun 4, 2011 (permalink)

    Hello.
    I have RadGroupBox control placed on RadPageView. The problem is with RadGroupBox colors: in desing mode everything is ok (see desinger.PNG from atachement), but when I run my application, the BackColor of RagGroupBox seems to be from main form instead of PadPage (see running.PNG), so it looks strange.

    How to fix this problem?

    (version Q1 2011, WinForms)

    Thanks in advance.
    Darek.
    Attached files

    Reply

  • Stefan Stefan admin's avatar

    Posted on Jun 9, 2011 (permalink)

    Hello Dariusz.

    Thank you for writing.

    RadGroupBox as every other control traverses its parents until it finds a parent with a explicitly set Backcolor property. If such is not found, it will take it from the form since it is the last parent in the hierarchy of controls. Just like in your case, where the group box color is taken from the form, since the RadPageViewPage and RadPageView Backcolors are not explicitly set and they hold their default values. 

    If you want the group box to take the color from the RadPageViewPage, simply set the group box Backcolor to Transparent:
    radGroupBox1.BackColor = Color.Transparent;

    However, there is an issue, with the design-time display - it is not refreshed correctly to show you the real backcolor. I have added this issue into our Public Issue Tracking System. Please follow this link in order to subscribe to its status updates and also to add your vote for it.

    I have added 500 Telerik points to your account for this report. 

    Should you have any other questions or suggestions, do not hesitate to contact us.
     
    Greetings,
    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.

    Reply

  • Posted on Jun 15, 2011 (permalink)

    Thanks, but setting BackColor=Transparent works for RadGroupBox "rectangle area" but doesn't affect Header back color.

    Reply

  • Stefan Stefan admin's avatar

    Posted on Jun 21, 2011 (permalink)

    Hello Darek,

    Thank you for your reply.

    Changing the BackColor of the header element can be achieved by setting its FillPrimitive BackColor:
    radGroupBox1.GroupBoxElement.Header.Fill.BackColor = Color.Transparent;

    Please note, that the header element is laying over the border of the content area and if you want to move it, you can set its Margin:
    radGroupBox1.GroupBoxElement.Header.Margin = new Padding(0, 0, 0, 11);

    I hope that you find this information useful. Should you have any other questions, do not hesitate to contact us.
     
    All the best,
    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.

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Panels, Labels, GroupBox > RadGroupBox BackColor from Form insead of RadPage
Related resources for "RadGroupBox BackColor from Form insead of RadPage"

[ Features | Demos | Documentation | Knowledge Base | Telerik TV | Code Library | Step-by-step Tutorial | Blogs | Self-Paced Trainer ]