Panel Rounded Corners Issue

4 posts, 1 answers
  1. Exchange
    Exchange avatar
    11 posts
    Member since:
    Oct 2012

    Posted 06 Dec 2012 Link to this post

    Hi! I am creating a panel with rounded corners, I followed the documentation here and was able to get that. The problem comes when I wanna change the color of the panel. For instance, I have a gray background on my app, and the panel has a white background. Instead of only seeing the rounded corners on the panel... I am seeing the square corners in white and then a rounded border around the panel. See screenshot. Suggestions on how to hide the square corners?


    Thanks!
  2. Answer
    Plamen
    Admin
    Plamen avatar
    132 posts

    Posted 07 Dec 2012 Link to this post

    Hello,

    Thank you for writing.

    When you set the BackColor to the control, as you can see it styles the whole control. To achieve your scenario, after setting the Shape of the PanelElement, you need to introduce your BackColor setting to the FillPrimitive. Here is an example:
    radPanel1.PanelElement.Shape = new RoundRectShape();
    radPanel1.PanelElement.PanelFill.GradientStyle = GradientStyles.Solid;
    radPanel1.PanelElement.PanelFill.BackColor = Color.Red;

    I hope that you find this information useful. Should you have any other questions, do not hesitate to contact us.

    Greetings,
    Plamen
    the Telerik team
    Q3’12 of RadControls for WinForms is available for download (see what's new). Get it today.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Exchange
    Exchange avatar
    11 posts
    Member since:
    Oct 2012

    Posted 07 Dec 2012 Link to this post

    perfect! thank you!
  5. Plamen
    Admin
    Plamen avatar
    132 posts

    Posted 12 Dec 2012 Link to this post

    Hi,

    I am glad that the issue you were facing is now resolved. Let me know if you have additional questions.

    Regards,
    Plamen
    the Telerik team
    Q3’12 of RadControls for WinForms is available for download (see what's new). Get it today.
Back to Top