Border.CornerRadius 属性

定义

获取或设置一个值,该值表示将 Border 的角倒圆的程度。

public:
 property System::Windows::CornerRadius CornerRadius { System::Windows::CornerRadius get(); void set(System::Windows::CornerRadius value); };
public System.Windows.CornerRadius CornerRadius { get; set; }
member this.CornerRadius : System.Windows.CornerRadius with get, set
Public Property CornerRadius As CornerRadius

属性值

CornerRadius

用于描述将角倒圆的程度的 CornerRadius。 此属性没有默认值。

示例

以下示例演示如何设置此属性的值。

myBorder1 = new Border();
myBorder1.BorderBrush = Brushes.SlateBlue;
myBorder1.BorderThickness = new Thickness(5, 10, 15, 20);
myBorder1.Background = Brushes.AliceBlue;
myBorder1.Padding = new Thickness(5);
myBorder1.CornerRadius = new CornerRadius(15);
Dim myBorder1 As New Border()
myBorder1.BorderBrush = Brushes.SlateBlue
myBorder1.BorderThickness = New Thickness(5, 10, 15, 20)
myBorder1.Background = Brushes.AliceBlue
myBorder1.Padding = New Thickness(5)
myBorder1.CornerRadius = New CornerRadius(15)
<Border BorderBrush="SlateBlue" BorderThickness="5,10,15,20" Background="AliceBlue" Padding="5" CornerRadius="15">

注解

虽然属性名称表明只能使用单一值, CornerRadius 但也支持非统一弧度。 太大的半径值会进行缩放,以便它们从角到角落顺利混合。

依赖项属性信息

标识符字段 CornerRadiusProperty
元数据属性设置为 true AffectsMeasure, AffectsRender

适用于

另请参阅