CornerRadius Structure

 

Represents the radii of a rectangle's corners.

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

<TypeConverterAttribute(GetType(CornerRadiusConverter))>
Public Structure CornerRadius
	Implements IEquatable(Of CornerRadius)

NameDescription
System_CAPS_pubmethodCornerRadius(Double)

Initializes a new instance of the CornerRadius class with a specified uniform radius value for every corner or the rectangle.

System_CAPS_pubmethodCornerRadius(Double, Double, Double, Double)

Initializes a new instance of the CornerRadius class with the specified radius values for each corner of the rectangle.

NameDescription
System_CAPS_pubpropertyBottomLeft

Gets or sets the radius of the bottom-left corner.

System_CAPS_pubpropertyBottomRight

Gets or sets the radius of the bottom-right corner.

System_CAPS_pubpropertyTopLeft

Gets or sets the radius of the top-left corner.

System_CAPS_pubpropertyTopRight

Gets or sets the radius of the top-right corner.

NameDescription
System_CAPS_pubmethodEquals(CornerRadius)

Compares two CornerRadius structures for equality.

System_CAPS_pubmethodEquals(Object)

Determines whether the specified Object is a CornerRadius and whether it contains the same corner radius values as this CornerRadius. (Overrides ValueType.Equals(Object).)

System_CAPS_pubmethodGetHashCode()

Returns the hash code for this CornerRadius. (Overrides ValueType.GetHashCode().)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns the string representation of the CornerRadius. (Overrides ValueType.ToString().)

NameDescription
System_CAPS_puboperatorSystem_CAPS_staticEquality(CornerRadius, CornerRadius)

Compares two CornerRadius structures for equality.

System_CAPS_puboperatorSystem_CAPS_staticInequality(CornerRadius, CornerRadius)

Compares two CornerRadius structures for inequality.

This class has four properties, TopLeft, TopRight, BottomLeft, and BottomRight, corresponding to the individual corners of the rectangle. Each is a Double structure that can be set independently of the others.

The radii cannot be negative.

<object property="TopLeft,TopRight,BottomRight,BottomLeft "/>
- or -
<object property="AllCorners"/>

TopLeft

Double value that specifies the radius of the top left corner.

TopRight

Double value that specifies the top right corner.

BottomRight

Double value that specifies the bottom right corner.

BottomLeft

Double value that specifies the bottom left corner.

AllCorners

If only a single Double value is specified, that measure is applied to ALL of the TopLeft, TopRight, BottomRight, and BottomLeft corners of the CornerRadius.

System_CAPS_noteNote

Values need not include the decimal point explicitly when specified as a string. The string "1" provided in XAML evaluates to a value of 1.0 when referenced in code.

The following example shows how to set the value of the CornerRadius property by using Extensible Application Markup Language (XAML) and code.

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">

.NET Framework
Available since 3.0
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: