)
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 programmatically set the TabPageAdv to edit mode in WinForms TabControlAdv?

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

Renaming tabitems

You can programmatically set the TabPageAdv to edit mode by deriving the TabControlAdv and invoking the StartLabelEdit() function.

C#

void radioButtonAdv1_CheckChanged(object sender, EventArgs e)
{
   if (this.radioButtonAdv1.Checked)
   {
     //Sets the TabControlAdv in the LabelEdit mode.
     this.tabControlAdv1.LabelEdit = true;
     this.tabControlAdv1.StartEdit();
   }
   else if (this.radioButtonAdv2.Checked)
     //Disables the LabelEdit behavior of the TabControlAdv.
     this.tabControlAdv1.LabelEdit = false;
}
//Creates a custom control.
public class MyTabControl : TabControlAdv
{
   public MyTabControl() : base()
   {    }
   //Sets the TabPageAdv in the edit mode.
   public void StartEdit()
   {
      StartLabelEdit();
   }
}

VB

Private Sub radioButtonAdv1_CheckChanged(ByVal sender As Object, ByVal e As EventArgs)
   If Me.radioButtonAdv1.Checked Then
     'Sets the TabControlAdv in the LabelEdit mode.
     Me.tabControlAdv1.LabelEdit = True
     Me.tabControlAdv1.StartEdit()
   ElseIf Me.radioButtonAdv2.Checked Then
     'Disables the LabelEdit behavior of the TabControlAdv.
     Me.tabControlAdv1.LabelEdit = False
   End If
End Sub
'Creates a custom control.
Public Class MyTabControl
    Inherits TabControlAdv
    Public Sub New()
        MyBase.New()
    End Sub
    'Sets the TabPageAdv in the edit mode.
    Public Sub StartEdit()
        StartLabelEdit()
    End Sub
End Class

 

Note:

The property named “LabelEdit” in the TabControlAdv should be enabled to set the TabPageAdv in edit mode.


TabControlAdv displayed in LabelEdit mode

Figure 1: TabControlAdv displayed in LabelEdit mode

LabelEdit mode is disabled in TabControlAdv

Figure 2: LabelEdit mode is disabled in TabControlAdv

Samples:

C#: TabControlAdv_LabelEdit_C#

VB: TabControlAdv_LabelEdit_VB

Reference link: https://help.syncfusion.com/windowsforms/tabcontrol/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