Articles in this section
Category / Section

How to customize the dropdown button appearance in WInForms SplitButton?

1 min read

Customize the dropdown button appearance

In WinForms SplitButton, you can customize the dropdown arrow appearance by using its function named DrawArrow.

C#

//Draws an arrow of the SplitButton
public void DrawArrow(int left, int top, int width, int height, PaintEventArgs e, Color ArrowColor)
{
    int StartPoint = left + 5;
    int EndPoint = StartPoint + width / 2;
    int HeightPoint = height;
    int TopPoint = height / 2 - 6;
    ArrowColorDefault = new SolidBrush(Color.Red);
    e.Graphics.FillPolygon(ArrowColorDefault, new Point[] { new Point(StartPoint, TopPoint ), new Point(StartPoint, TopPoint + 12 ), new Point(StartPoint + 7 , TopPoint  + 6) });
}

VB

'Draws an arrow of the SplitButton
Public Sub DrawArrow(ByVal left As Integer, ByVal top As Integer, ByVal width As Integer, ByVal height As Integer, ByVal e As PaintEventArgs, ByVal ArrowColor As Color) Implements ISplitButtonRenderer.DrawArrow
    Dim StartPoint As Integer = left + 5
    Dim EndPoint As Integer = StartPoint + width \ 2
    Dim HeightPoint As Integer = height
    Dim TopPoint As Integer = height \ 2 - 6
    ArrowColorDefault = New SolidBrush(Color.Red)
    e.Graphics.FillPolygon(ArrowColorDefault, New Point() {New Point(StartPoint, TopPoint), New Point(StartPoint, TopPoint + 12), New Point(StartPoint + 7, TopPoint + 6)})
End Sub

 

Show the default arrow of WinForms splitbutton

Figure 1: Default arrow of the SplitButton

Show the custom arrow of WinForms splitbutton

Figure 2: Custom arrow of the SplitButton

Samples:

C#: https://www.syncfusion.com/downloads/support/directtrac/139533/SplitButton_CustomArrow-427032526.zip

VB: https://www.syncfusion.com/downloads/support/directtrac/137665/SplitButton_CustomArrow_VB-1009365277.zip

Reference link: https://help.syncfusion.com/windowsforms/split-button/appearance-customization

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied