ButtonX and ButtonItem controls support custom shapes out of the box. To create custom shape you need to create a Class which inherits from ShapeDescriptor and provide implementation. Here is sample code which creates triangle button shape:

C#

public class TriangleButtonShape : DevComponents.DotNetBar.ShapeDescriptor
{
    public override bool CanDrawShape(Rectangle bounds)
    {
        return true;
    }
 
    public override System.Drawing.Drawing2D.GraphicsPath GetInnerShape(Rectangle bounds, int borderSize)
    {
        bounds.Inflate(-borderSize, -borderSize);
 
        GraphicsPath path = GetTriangleShape(bounds);
 
        return path;
    }
 
    private static GraphicsPath GetTriangleShape(Rectangle bounds)
    {
        GraphicsPath path = new GraphicsPath();
 
        path.AddLine(bounds.X + bounds.Width / 2, bounds.Y, bounds.X, bounds.Bottom);
        path.AddLine(bounds.X, bounds.Bottom, bounds.Right, bounds.Bottom);
 
        path.CloseAllFigures();
 
        return path;
    }
 
    public override System.Drawing.Drawing2D.GraphicsPath GetShape(Rectangle bounds)
    {
        GraphicsPath path = GetTriangleShape(bounds);
 
        return path;
    }
}

VB

Public Class TriangleButtonShape
    Inherits DevComponents.DotNetBar.ShapeDescriptor
    Public Overrides Function CanDrawShape(bounds As Rectangle) As Boolean
        Return True
    End Function
 
    Public Overrides Function GetInnerShape(bounds As Rectangle, borderSize As Integer) As System.Drawing.Drawing2D.GraphicsPath
        bounds.Inflate(-borderSize, -borderSize)
 
        Dim path As GraphicsPath = GetTriangleShape(bounds)
 
        Return path
    End Function
 
    Private Shared Function GetTriangleShape(bounds As Rectangle) As GraphicsPath
        Dim path As New GraphicsPath()
 
        path.AddLine(bounds.X + bounds.Width / 2, bounds.Y, bounds.X, bounds.Bottom)
        path.AddLine(bounds.X, bounds.Bottom, bounds.Right, bounds.Bottom)
 
        path.CloseAllFigures()
 
        Return path
    End Function
 
    Public Overrides Function GetShape(bounds As Rectangle) As System.Drawing.Drawing2D.GraphicsPath
        Dim path As GraphicsPath = GetTriangleShape(bounds)
 
        Return path
    End Function
End Class

Then you simply assign new instance of your custom shape descriptor to Shape property like this:

C#

buttonX11.Shape = new TriangleButtonShape();

VB

buttonX11.Shape = New TriangleButtonShape()

Related posts:

  1. How to change default ButtonX and ButtonItem colors, DotNetBar for WinForms
  2. Customizing Keyboard Control in DotNetBar for WinForms
  3. How to selectively display Gallery items based on Gallery state, popup or inline
  4. How to add custom panels to AdvPropertyGrid
  5. How to show custom Tooltip for Schedule Appointments