开发者

How can I make curved shaped panels and buttons in C# WPF?

Is it possible to create non-rectangular buttons and panels i开发者_JS百科n C# Windows application without any sharp edges ?


You can do just about anything design-wise if you can use WPF. For example: http://geekswithblogs.net/cskardon/archive/2008/06/20/roundedbutton-button-style-wpf.aspx.

EDIT:

OK, no WPF. How about this then:

  • Creating Gel Buttons with Windows Forms : Part 1
  • Creating Gel Buttons with Windows Forms : Part 2
  • Creating Gel Buttons with Windows Forms : Part 3

A pure Windows Forms approach.


Customising the .NET Panel control:

http://www.codeproject.com/KB/cpp/custompanel.aspx?msg=1042196

BorderWidth - Controls the width of the border.

BorderColor - The color of the border.

Curvature - The radius of the curve used to draw the corners of the panel.

CurveMode - The style of the curves to be drawn on the control.


In WPF, you can set the specify the curvature of a border with the CornerRadius attribute.

<Border BorderBrush="#FF000000" BorderThickness="1" CornerRadius="8">
   <Grid/>
</Border>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜