)
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 clear the compile error in Windows Forms TabControlAdv?

Platform: WinForms |
Control: TabControlAdv |
Published Date: December 4, 2019 |
Last Revised Date: December 4, 2019

Clear the compilation error

The 'Syncfusion.Windows.Forms.Tools.TabControlAdv' namespace does not contain a definition for NavigationControl.

The NavigationControl property has been changed as TabPrimitives for v.4.4. TabPrimitives provides more flexibility and it allows users to add any number of buttons in the TabPanel.

You can comment out the NavigationControl related code in the designer generated code and compile the solution to make it work properly

To work with TabPrimitives

TabPrimitives can be made visible by setting TabPrimitivesHost.Visible property to true.

TabPrimitivesHost

Click on the TabPrimitivesCollection to bring up a collection editor and add the TabPrimitives as shown below.

https://help.syncfusion.com/windowsforms/tabcontroladv/tabprimitives_images/tabprimitives_img6.jpeg

CollectionEditor

To add the TabPrimitives programatically,

C#

using Syncfusion.Windows.Forms.Tools;
this.tabControlAdv1.TabPrimitivesHost.Visible = true;
this.tabControlAdv1.TabPrimitivesHost.TabPrimitives.Add(new TabPrimitive(TabPrimitiveType.FirstTab, null, Color.Empty, true, 1, "TabPrimitive0"));
this.tabControlAdv1.TabPrimitivesHost.TabPrimitives.Add(new TabPrimitive(TabPrimitiveType.PreviousPage, null, Color.Empty, true, 1, "TabPrimitive1"));
this.tabControlAdv1.TabPrimitivesHost.TabPrimitives.Add(new TabPrimitive(TabPrimitiveType.PreviousTab, null, Color.Empty, true, 1, "TabPrimitive2"));
this.tabControlAdv1.TabPrimitivesHost.TabPrimitives.Add(new TabPrimitive(TabPrimitiveType.NextTab, null, Color.Empty, true, 1, "TabPrimitive3"));
this.tabControlAdv1.TabPrimitivesHost.TabPrimitives.Add(new TabPrimitive(TabPrimitiveType.NextPage, null, Color.Empty, true, 1, "TabPrimitive4"));
this.tabControlAdv1.TabPrimitivesHost.TabPrimitives.Add(new TabPrimitive(TabPrimitiveType.NextPage, null, Color.Empty, true, 1, "TabPrimitive5"));
this.tabControlAdv1.TabPrimitivesHost.TabPrimitives.Add(new TabPrimitive(TabPrimitiveType.Close, null, Color.Empty, true, 1, "TabPrimitive6"));

 

C#

// To generate click events for custom TabPrimitiveType
private void tabControlAdv1_TabPrimitiveClick (object sender, Syncfusion.Windows.Forms.Tools.TabPrimitiveClickEventArgs e)
{
      if (e.TabPrimitive.Name == "TabPrimitive7")
      {
          // Add the code here.
       }
}

 

UG document link: https://help.syncfusion.com/windowsforms/tabcontroladv/events#tabprimitiveclick-event

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