# Custom Shapes

To create a custom shape you need to inherit the `ElementShape` class and override the **CreatePath** method. In it you should create and return the shape path. For example the following code creates a cross shape.

  



```C#
public class CrossShape : ElementShape
{
    public CrossShape()
    {
        this.Width = 20;
    }
    public override GraphicsPath CreatePath(Rectangle bounds)
    {
        GraphicsPath path = new GraphicsPath();
        path.AddRectangle(new RectangleF(bounds.X, (bounds.Y + bounds.Height / 2) - Width / 2, bounds.Width, Width));
        path.AddRectangle(new RectangleF((bounds.X + bounds.Width / 2) - Width / 2, bounds.Y, Width, bounds.Height));
        path.CloseFigure();
        return path;
    }
    public int Width { get; set; }
}

```

```VB.NET
Public Class CrossShape
    Inherits ElementShape
    Public Sub New()
        Me.Width = 20
    End Sub
    Public Overrides Function CreatePath(ByVal bounds As Rectangle) As GraphicsPath
        Dim path As New GraphicsPath()
        path.AddRectangle(New RectangleF(bounds.X, (bounds.Y + bounds.Height \ 2) - Width \ 2, bounds.Width, Width))
        path.AddRectangle(New RectangleF((bounds.X + bounds.Width \ 2) - Width \ 2, bounds.Y, Width, bounds.Height))
        path.CloseFigure()
        Return path
    End Function
    Public Property Width() As Integer
End Class

```

 

Figure 1 shows the result from the above code. The shape is applied to a RadPanel.

> caption Figure 1: The cross shape.

![Telerik UI for WinForms custom cross shape applied to a RadPanel](https://www.telerik.com/products/winforms/documentation/assets/cc1fb95a428f19935bcc6cb2b356ba63/custom-shape001.png)

## See Also

* [Diamond Shape](https://www.telerik.com/products/winforms/documentation/telerik-presentation-framework/shapes/diamond-shape)

* [Donut Shape](https://www.telerik.com/products/winforms/documentation/telerik-presentation-framework/shapes/donut-shape)

* [Ellipse Shape](https://www.telerik.com/products/winforms/documentation/telerik-presentation-framework/shapes/elipse-shape)

* [Heart Shape](https://www.telerik.com/products/winforms/documentation/telerik-presentation-framework/shapes/heart-shape)

* [Media Shape](https://www.telerik.com/products/winforms/documentation/telerik-presentation-framework/shapes/media-shape)

* [Overview](https://www.telerik.com/products/winforms/documentation/telerik-presentation-framework/shapes/overview)

* [RoundRect Shape](https://www.telerik.com/products/winforms/documentation/telerik-presentation-framework/shapes/round-rect-shape)

* [Star Shape](https://www.telerik.com/products/winforms/documentation/telerik-presentation-framework/shapes/star-shape)
