)
We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to customize the dropdown button appearance in WInForms SplitButton?

Platform: WinForms |
Control: SplitButton |
Published Date: April 14, 2015 |
Last Revised Date: January 23, 2020

Customize the dropdown button appearance

In 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 splitbutton

Figure 1: Default arrow of the SplitButton

Show the custom arrow of splitbutton

Figure 2: Custom arrow of the SplitButton

Samples:

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

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

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

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon