New to Telerik UI for WinFormsStart a free 30-day trial

Represents a rounded rectangle shape with configurable corner radius and individual corner rounding control.

Definition

Constructors

Initializes a new instance of the RoundRectShape class with default settings.

C#
public RoundRectShape()

Initializes a new instance of the RoundRectShape class with a container.

C#
public RoundRectShape(IContainer components)
Parameters:componentsIContainer

The container to add this shape to.

Initializes a new instance of the RoundRectShape class with the specified radius and corner settings.

C#
public RoundRectShape(int radius, bool topLeftRounded, bool bottomLeftRounded, bool topRightRounded, bool bottomRightRounded)
Parameters:radiusint

The radius for rounded corners.

topLeftRoundedbool

true to round the top-left corner; otherwise, false.

bottomLeftRoundedbool

true to round the bottom-left corner; otherwise, false.

topRightRoundedbool

true to round the top-right corner; otherwise, false.

bottomRightRoundedbool

true to round the bottom-right corner; otherwise, false.

Initializes a new instance of the RoundRectShape class with the specified radius.

C#
public RoundRectShape(int radius)
Parameters:radiusint

The radius for all rounded corners.

Properties

Gets or sets value indicating whether the bottom left corner of the shape should be round

C#
public bool BottomLeftRounded { get; set; }

Gets or sets value indicating whether bottom right corner of the shape should be round

C#
public bool BottomRightRounded { get; set; }

Gets or sets the radius of the rounded corners.

C#
public int Radius { get; set; }
Property Value:

The radius in pixels for rounded corners. Default is 5.

Gets or sets value indicating whether top left corner of the shape should be round

C#
public bool TopLeftRounded { get; set; }

Gets or sets value indicating whether top right corner of the shape should be round

C#
public bool TopRightRounded { get; set; }

Methods

Creates a GraphicsPath using the specified rectangle as bounds. This method must be implemented by derived classes.

C#
public override GraphicsPath CreatePath(Rectangle bounds)
Parameters:boundsRectangle

The rectangle defining the bounds for the shape.

Returns:

GraphicsPath

A GraphicsPath representing the shape within the specified bounds.

Overrides: ElementShape.CreatePath(Rectangle)

Creates round rectangle like path.

C#
public override GraphicsPath CreatePath(RectangleF bounds)
Parameters:boundsRectangleFReturns:

GraphicsPath

Overrides: ElementShape.CreatePath(RectangleF)

C#
public override Region CreateRegion(Rectangle bounds)
Parameters:boundsRectangleReturns:

Region

Overrides: ElementShape.CreateRegion(Rectangle)

Deserializes properties. Required for telerik deserialization mechanism.

C#
public override void DeserializeProperties(string propertiesString)
Parameters:propertiesStringstring

Overrides: ElementShape.DeserializeProperties(string)

Serializes properties. Required for telerik serialization mechanism.

C#
public override string SerializeProperties()
Returns:

string

Overrides: ElementShape.SerializeProperties()

C#
protected override bool ShouldMirrorPath()
Returns:

bool

Overrides: ElementShape.ShouldMirrorPath()