Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Border.CornerRadius Property

Gets or sets the radius for the corners of the border.

Namespace:  System.Windows.Controls
Assembly:  System.Windows (in System.Windows.dll)

public CornerRadius CornerRadius { get; set; }
<Border CornerRadius="uniformRadius"/>
- or -
<Border CornerRadius="topLeft,topRight,bottomRight,bottomLeft"/>

XAML Values

uniformRadius

A value that specifies a uniform radius size in pixels. The uniformRadius value is applied to all four CornerRadius properties (TopLeft, TopRight, BottomRight, BottomLeft).

topLeft

Sets the initial TopLeft.

topRight

Sets the initial TopRight.

bottomRight

Sets the initial BottomRight.

bottomLeft

Sets the initial BottomLeft.

  • If you specify an attribute string with two or three values, only the first value is respected and is treated as the uniformRadius (the other values are ignored). You must specify all four values to use a different behavior than uniformRadius.

  • In the XAML syntaxes shown, you can use a space rather than a comma as the delimiter between values.

Property Value

Type: System.Windows.CornerRadius
The degree to which the corners are rounded.

Dependency property identifier field: CornerRadiusProperty

CornerRadius can be a single uniform value for all corners or four unique values. For more information, see CornerRadius.

The following example shows how to set the corners to be rounded.


<Border Background="Cyan" CornerRadius="20" Grid.Column="2" Grid.Row="2">
    <TextBlock Text="Background Brush" TextWrapping="Wrap" VerticalAlignment="Center" />
</Border>


Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft