Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Panels, Labels, GroupBox > RadPanel RoundRectShape

Answered RadPanel RoundRectShape

Feed from this thread
  • Marcello avatar

    Posted on Nov 23, 2010 (permalink)

    Hi, 
    i am trying to specialize a RadPanel in order to use RoundRectShape and custom background color. 
    There's something wrong with this code? At runtime it seems that my code does not have any effect on the Panel

    Thanks 
    Marcello


    public class FooPanel : RadPanel
    {
        public FooPanel()
            : base()
        {
            
        }
     
        protected override void OnLoad(System.Drawing.Size desiredSize)
        {
            RoundRectShape shape = new RoundRectShape();
     
            shape.BottomLeftRounded = true;
            shape.BottomRightRounded = true;
            shape.TopLeftRounded = true;
            shape.TopRightRounded = true;
            shape.Radius = 25;
            this.RootElement.Shape = shape;
     
            base.OnLoad(desiredSize);
        }
    }

    Reply

  • Posted on Nov 23, 2010 (permalink)

    Hello,

    Just replace
    this.RootElement.Shape = shape;

    With
    this.PanelElement.Shape = shape;

    and it should all work fine

    Hope that helps
    Richard

    Reply

  • Marcello avatar

    Posted on Nov 23, 2010 (permalink)

    Thank you Richard it works fine.

    Reply

  • Posted on Nov 23, 2010 (permalink)

    Glad to have been able to help.
    Please mark as answer so others can find the solution too.

    All the best
    Richard

    Reply

  • Tim avatar

    Posted on May 4, 2012 (permalink)

    Hey Guys

    Was just trying to figure this out myself.  Great little fix

    Thanks
    Tim

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Panels, Labels, GroupBox > RadPanel RoundRectShape
Related resources for "RadPanel RoundRectShape"

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