Articles in this section
Category / Section

How to make scroll buttons visible all the time on WinForms TabControlAdv in single line mode?

1 min read

Scroll buttons

You can make the scroll buttons visible on the TabControlAdv when it is in single line mode. This can be achieved by creating the custom class and overriding the AdjustScrollButtonDimensions function in the TabControlAdv.

C#

//Sets the TabControlAdv in single line mode.
this.tabControlAdv1.Multiline = false;
public class TabControlExt : TabControlAdv
{
    public TabControlExt()
    {
        //Initializes the TabControl.
    }
    protected override void AdjustScrollButtonDimensions(ref RectangleF tabPanelBounds, bool scrollNeeded)
    {
        // Init the scrollbuttons used to scroll the tabs, when not already inited.
        if (this.ScrollButtons == null && !this.Multiline)
            InitScrollButtons();
        // Needs the second argument to enable in order to show the scroll button.
        base.AdjustScrollButtonDimensions(ref tabPanelBounds, true);
    }
}

VB

Public Class TabControlExt
    Inherits TabControlAdv
    Public Sub New()
        'Initializes the TabControl.
    End Sub
    Protected Overrides Sub AdjustScrollButtonDimensions(ByRef tabPanelBounds As RectangleF, ByVal scrollNeeded As Boolean)
        'Init the scrollbuttons used to scroll the tabs, when not already inited.
        If Me.ScrollButtons Is Nothing AndAlso (Not Me.Multiline) Then
            InitScrollButtons()
        End If
        'Needs the second argument to enable in order to show the scroll button.
        MyBase.AdjustScrollButtonDimensions(tabPanelBounds, True)
    End Sub
End Class

 

Note:

The TabControlAdv can be set as single line by disabling the Multiline property in the TabControlAdv.


TabControlAdv with default appearance

Figure 1: TabControlAdv with default appearance

Show the scroll buttons in TabControl

Figure 2: Scroll buttons in the TabControl

Samples:

C#: TabControlAdv_ScrollButton_C#

VB: TabControlAdv_ScrollButton_VB

Reference link: https://help.syncfusion.com/windowsforms/tabcontrol/interactive-features

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