)
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 make scroll buttons visible all the time on WinForms TabControlAdv in single line mode?

Platform: WinForms |
Control: TabControlAdv |
Published Date: April 30, 2011 |
Last Revised Date: January 30, 2020

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

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