This is a migrated thread and some comments may be shown as answers.
Panel Rounded Corners Issue
3 Answers 194 Views
This is a migrated thread and some comments may be shown as answers.
Exchange
Top achievements
Rank 1
Exchange asked on 06 Dec 2012, 04:50 PM
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!

3 Answers, 1 is accepted

Sort by
0
Accepted
Plamen
Telerik team
answered on 07 Dec 2012, 04:09 PM
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.
0
Exchange
Top achievements
Rank 1
answered on 07 Dec 2012, 05:09 PM
perfect! thank you!
0
Plamen
Telerik team
answered on 12 Dec 2012, 03:26 PM
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.
Tags
Panel
Asked by
Exchange
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Exchange
Top achievements
Rank 1
Share this question
or