-api-id | -api-type | ms.custom |
---|---|---|
P:Windows.UI.Xaml.Controls.Control.CornerRadius |
winrt property |
RS5 |
Gets or sets the radius for the corners of the control's border.
<control CornerRadius="uniformRadius"/>
- or -
<control CornerRadius="topLeft,topRight,bottomRight,bottomLeft"/>
- uniformRadius
- uniformRadiusA value that specifies a uniform radius size in pixels. The uniformRadius value is applied to all four CornerRadius values.
- topLeft
- topLeftSets the initial TopLeft value.
- topRight
- topRightSets the initial TopRight value.
- bottomRight
- bottomRightSets the initial BottomRight value.
- bottomLeft
- bottomLeftSets the initial BottomLeft value.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.
The degree to which the corners are rounded, expressed as values of the CornerRadius structure.
Member components of a CornerRadius value cannot be negative.
CornerRadius property on Control behaves the same way Border.CornerRadius does. CornerRadius is a rendering artifact and does not impact layout of the contents (clipping may occur).
The default CornerRadius value in all control templates is 0. Setting the CornerRadius property impacts those controls that have a Border in their ControlTemplate (Example: Button, ComboBox).
<Button Content="Button"
Background="Blue"
BorderThickness="1.0"
BorderBrush="Black"
CornerRadius="15" />