Control.CornerRadius Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the radius for the corners of the control's border.
public:
property CornerRadius CornerRadius { CornerRadius get(); void set(CornerRadius value); };
CornerRadius CornerRadius();
void CornerRadius(CornerRadius value);
public CornerRadius CornerRadius { get; set; }
var cornerRadius = control.cornerRadius;
control.cornerRadius = cornerRadius;
Public Property CornerRadius As CornerRadius
<control CornerRadius="uniformRadius"/>
- or -
<control CornerRadius="topLeft,topRight,bottomRight,bottomLeft"/>
The degree to which the corners are rounded, expressed as values of the CornerRadius structure.
Device family |
Windows 10, version 1809 (introduced in 10.0.17763.0)
|
API contract |
Windows.Foundation.UniversalApiContract (introduced in v7.0)
|
<Button Content="Button"
Background="Blue"
BorderThickness="1.0"
BorderBrush="Black"
CornerRadius="15" />
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).
Product | Versions |
---|---|
WinRT | Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100 |