Buttons on tabs

Is it possible to place buttons on the tabs in an TabSplitterContainer?

1 Reply 1 reply marked as answer

UN Unknown Syncfusion Team July 13, 2020 10:40 AM UTC

Hi John, 

Thanks for contacting Syncfusion support. 

We have checked your query ”Need to place buttons in TabSplitter Items in TabSplitterContainers control” and we cannot add any controls other than SplitterPages in TabSplitterItems (in both top and bottom panels), but we can add the button or any controls in the SplitterPage as shown in below screenshot. Please refer the below code snippet for same. 

C#: 
TabSplitterContainer tabSplitterContainer1 = new TabSplitterContainer() { Dock= DockStyle.Fill}; 
            this.Controls.Add(tabSplitterContainer1); 

            TabSplitterPage tabSplitterPage1 = new TabSplitterPage(); 
            TabSplitterPage tabSplitterPage2 = new TabSplitterPage(); 

            tabSplitterPage1.Text = "XAML"; 
            tabSplitterPage2.Text = "Design"; 

            Button button = new Button() { Dock = DockStyle.Fill , Text="Button Addded", ForeColor = Color.White, BackColor= Color.Gray}; 
            tabSplitterPage1.Controls.Add(button); 

            // Set back color. 
            tabSplitterPage1.BackColor = System.Drawing.SystemColors.ControlLightLight; 
            tabSplitterPage2.BackColor = System.Drawing.SystemColors.ControlLightLight; 

            //Set size to tabsplittercontainer 
            tabSplitterContainer1.Size = new System.Drawing.Size(443, 315); 

            // Add it to TabSplitterContainer. 
            tabSplitterContainer1.PrimaryPages.AddRange(new TabSplitterPage[] { tabSplitterPage1 }); 
            tabSplitterContainer1.SecondaryPages.AddRange(new TabSplitterPage[] { tabSplitterPage2 }); 

Screenshot : 
 

Regards, 
Niranjan Kumar Gopalan 


Marked as answer
Loader.
Up arrow icon