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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Can I Add Custom Controls Like button or DropDown etc on Tab

Thread ID:





120146 Sep 4,2015 09:08 AM UTC Sep 7,2015 12:05 PM UTC WinForms 1
Tags: TabbedMDIManager
Asked On September 4, 2015 09:08 AM UTC


I am looking a Tab to have a Custom Controls like a close button on active tab or may be all tabs can TabbedDocking Manager Do that?


This is what I am looking for

Ashwini Jaya Preetha Durai Samy [Syncfusion]
Replied On September 7, 2015 12:05 PM UTC

Hi Trushar,

Thank you for using Syncfusion products.

At present we do not have direct support to achieve the requirement for adding custom control in TabControlAdv or TabbedMDIManager. But this can be achieved by handling the DrawItem event in TabControlAdv. Please refer the below code snippet.

Code snippet [VB]:

'DrawItem event of TabControlAdv

              Private Sub tabControlAdv1_DrawItem(ByVal sender As Object, ByVal drawItemInfo As Syncfusion.Windows.Forms.Tools.DrawTabEventArgs)

                     Dim lgb As LinearGradientBrush

                     ' Use LinearGradientBrush to set gradient.

                     ' Use GetTabRect to get the rectangle of the tabs.

                     If drawItemInfo.Index <> Me.tabControlAdv1.SelectedIndex Then

                           ' For the non-selected tabs

                           lgb = New System.Drawing.Drawing2D.LinearGradientBrush(Me.tabControlAdv1.GetTabRect(drawItemInfo.Index), Color.FromArgb(197, 197, 173), Color.FromArgb(228, 228, 212), LinearGradientMode.Horizontal)


                           ' For the selected tab

                           lgb = New System.Drawing.Drawing2D.LinearGradientBrush(Me.tabControlAdv1.GetTabRect(drawItemInfo.Index), Color.White, Color.WhiteSmoke, LinearGradientMode.Horizontal)

                     End If

                     Dim positions() As Single = { 0.0f, 0.05f, 0.95f, 1.0f }

                     Dim factors() As Single = { 0.4f, 1.0f, 0.05f, 0.04f }

                     ' Blend settings

                     Dim blend As New Blend()

                     blend.Factors = factors

                     blend.Positions = positions

                     lgb.Blend = blend

                     drawItemInfo.Graphics.FillRectangle(lgb, Me.tabControlAdv1.GetTabRect(drawItemInfo.Index))


                     ' Draw the default borders and interior (text and image)


                     drawItemInfo.Graphics.DrawString(Me.tabControlAdv1.TabPages(drawItemInfo.Index).Text, drawItemInfo.Font, Brushes.Black, drawItemInfo.Bounds.X + 5, drawItemInfo.Bounds.Y + 5)

                     CloseButton = New Rectangle(drawItemInfo.Bounds.X + drawItemInfo.Bounds.Width - 15, drawItemInfo.Bounds.Y + 6, 10, 10)

                     drawItemInfo.Graphics.DrawLine(New Pen(Brushes.Black), New Point(CloseButton.X,CloseButton.Y), New Point(CloseButton.X+ CloseButton.Width, CloseButton.Y+CloseButton.Height))

                     drawItemInfo.Graphics.DrawLine(New Pen(Brushes.Black), New Point(CloseButton.X, CloseButton.Y+CloseButton.Height), New Point(CloseButton.X + CloseButton.Width, CloseButton.Y))

                     drawItemInfo.Graphics.DrawRectangle(New Pen(Brushes.Black), CloseButton)
              End Sub

We have also prepared a sample for TabbedMDIManager and TabControlAdv and it can be downloaded from the following location.

TabControlAdv Sample:  http://www.syncfusion.com/downloads/support/forum/120146/ze/TabControlAdvSampleVB1791071414

TabbedMDIManager Sample: http://www.syncfusion.com/downloads/support/forum/120146/ze/TabbedMDISampleVB2070263994

Please look into the sample and kindly let us know if it helps. If not please provide us more information about your like screen shot. That will be helpful for us to analyze and provide you the prompt solution as earlier as possible.

Please let us know if you need any further assistance,



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

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

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