Rounded corners in GroupBox control
How c开发者_开发知识库an I get rounded corners in a GroupBox in my form? Is there any option in the property tab?
When visual styles are enabled for your application and the FlatStyle
property is set to "System", the group boxes look like they have slightly rounded corners, but it's probably no more than 3 to 5 degrees. So I suppose this is not what you're looking for.
Unfortunately, there's no built-in way to customize its degree of roundedness. The only real solution is to use a custom control. You can either inherit off of the existing GroupBox
control and override its Paint
event to draw the borders yourself, or you can use one of these existing controls:
- http://roundedgroupbox.codeplex.com/
- http://weblogs.asp.net/andrewrea/archive/2008/02/18/my-own-version-of-a-winforms-rounded-groupbox-with-transparency.aspx
- http://www.codeproject.com/KB/miscctrl/grouper.aspx
Take a look at this open source controls: http://roundedgroupbox.codeplex.com/
精彩评论