RadPanel RoundRectShape

5 posts, 2 answers
  1. Marcello
    Marcello avatar
    8 posts
    Member since:
    Dec 2008

    Posted 23 Nov 2010 Link to this post

    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);
        }
    }
  2. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 23 Nov 2010 Link to this post

    Hello,

    Just replace
    this.RootElement.Shape = shape;

    With
    this.PanelElement.Shape = shape;

    and it should all work fine

    Hope that helps
    Richard
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Marcello
    Marcello avatar
    8 posts
    Member since:
    Dec 2008

    Posted 23 Nov 2010 Link to this post

    Thank you Richard it works fine.
  5. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 23 Nov 2010 Link to this post

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

    All the best
    Richard
  6. Tim
    Tim avatar
    4 posts
    Member since:
    Apr 2012

    Posted 04 May 2012 Link to this post

    Hey Guys

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

    Thanks
    Tim
Back to Top
UI for WinForms is Visual Studio 2017 Ready