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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to enable wordwrap in WinForms TabControlAdv?

Platform: WinForms |
Control: TabControlAdv


In  WinForms TabControlAdv, you can word wrap the TabPageAdv text by handling its DrawItem event.


void tabControlAdv1_DrawItem(object sender, Syncfusion.Windows.Forms.Tools.DrawTabEventArgs drawItemInfo)
    if(drawItemInfo.Graphics.MeasureString(tabText, drawItemInfo.Font).Width > WrapLength)
       enableMultiLine = true;
       ArrayList list = new ArrayList();
       string[] arr = tabText.Split();
       tabText = string.Empty;
       foreach (string item in arr)
          if (tabText == string.Empty)
            tabText = item + Environment.NewLine;
            tabText = tabText + item;
       tabRect = new RectangleF((float)drawItemInfo.Bounds.X, (float)drawItemInfo.Bounds.Y - 51,                                        (float)drawItemInfo.Bounds.Width, (float)drawItemInfo.Bounds.Height + 100);


Private Sub tabControlAdv1_DrawItem(sender As Object, drawItemInfo As Syncfusion.Windows.Forms.Tools.DrawTabEventArgs)
    If drawItemInfo.Graphics.MeasureString(tabText, drawItemInfo.Font).Width > WrapLength Then
       enableMultiLine = True
       Dim list As New ArrayList()
       Dim arr As String() = tabText.Split()
       tabText = String.Empty
       For Each item As String In arr
          If tabText = String.Empty Then
             tabText = item + Environment.NewLine
             tabText = tabText & item
          End If
    End If
    If enableMultiLine Then
       tabRect = New RectangleF(CSng(drawItemInfo.Bounds.X), CSng(drawItemInfo.Bounds.Y) - 51,   CSng(drawItemInfo.Bounds.Width), CSng(drawItemInfo.Bounds.Height) + 100)
    End If
End Sub

Sample: https://www.syncfusion.com/downloads/support/directtrac/general/TabControlAdv_MultiLine597364458.zip

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
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