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

RadPanel RoundRectShape

4 Answers 210 Views
Panel
This is a migrated thread and some comments may be shown as answers.
Marcello
Top achievements
Rank 1
Marcello asked on 23 Nov 2010, 05:04 PM
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);
    }
}

4 Answers, 1 is accepted

Sort by
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 23 Nov 2010, 05:48 PM
Hello,

Just replace
this.RootElement.Shape = shape;

With
this.PanelElement.Shape = shape;

and it should all work fine

Hope that helps
Richard
0
Marcello
Top achievements
Rank 1
answered on 23 Nov 2010, 06:13 PM
Thank you Richard it works fine.
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 23 Nov 2010, 06:16 PM
Glad to have been able to help.
Please mark as answer so others can find the solution too.

All the best
Richard
0
Tim
Top achievements
Rank 1
answered on 04 May 2012, 09:58 AM
Hey Guys

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

Thanks
Tim
Tags
Panel
Asked by
Marcello
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Marcello
Top achievements
Rank 1
Tim
Top achievements
Rank 1
Share this question
or