Getting rid of info desciption under tab control

I'm trying to remove the text block under the tab control so the entire area is occupied by the tab control and its tabs. Is there any way to do this?

I've attached a picture to illustrate what I'm trying to do.



3 Replies

VR Venkateshwaran Ramdoss Syncfusion Team July 6, 2018 06:18 AM UTC

Hi Elan, 

Thank you for using Syncfusion products. 

We can remove the place holder of tab content, menu and close button by getting those controls from VisualTree using FindDescendant method of VisualUtils helper class. Please find the code snippet for the same in the below. 

Code example 

private void MainWindow_Loaded(object sender, RoutedEventArgs e) 
{ 
    Border3D border = Syncfusion.Windows.Controls.VisualUtils.FindDescendant(tabcontrolext, typeof(Border3D)) as Border3D; 
    border.Visibility = Visibility.Collapsed; 
           
    TabPanelAdv tabpanel = Syncfusion.Windows.Controls.VisualUtils.FindDescendant(sender as Visual,  typeof(TabPanelAdv)) as TabPanelAdv; 
     
    if (tabpanel != null) 
       { 
          ToggleButton menubutton = tabpanel.Template.FindName("PART_MenuButton", 
                          tabpanel) as ToggleButton; 
          ToggleButton closebutton = tabpanel.Template.FindName("PART_CloseButton", 
                                          tabpanel) as ToggleButton; 
 
          if (menubutton != null) 
              menubutton.Visibility = Visibility.Collapsed; 
          if (closebutton != null) 
              closebutton.Visibility = Visibility.Collapsed; 
       } 
} 

We have prepared sample for your reference and it can be downloaded from the below link. 

 
Output 
 
 
 
Please check the above solution and let us know if it is helpful. 
 
Regards, 
Venkateshwaran V.R. 
 
 



EC Elan Canfield July 9, 2018 06:29 PM UTC

Is there any way to achieve this in the TabControlExt XAML code rather than the Code-Behind?


VR Venkateshwaran Ramdoss Syncfusion Team July 10, 2018 08:50 AM UTC

Hi Elan, 

Thank you for your update. 

Yes. We can achieve your requirement in XAML by editing the TabControlExt style. We have prepared a sample for the same. In this, we have collapsed the visibility of the Border3D which is used as a content holder of the TabItemExt in the TabControlExt and remove the CloseButton, MenuButton by setting ShowTabListContextMenu as False and CloseButtonType as Hide respectively. Please find the code snippet in the below. 

Code snippet 
 
<syncfusion:TabControlExt x:Name="tabcontrolext" ShowTabListContextMenu="False" CloseButtonType="Hide"  Style="{StaticResource AeroTabControlExtStyle}" ItemContainerStyle="{StaticResource AeroTabItemExtStyle}"> 
            <syncfusion:TabItemExt Header="0" Content="Firewing"/> 
            <syncfusion:TabItemExt Header="253" Content="Firewings 253" /> 
</syncfusion:TabControlExt> 

We have prepared a sample for your reference and it can be downloaded from the below link. 

 
Please refer the below documentations for more details about the Close and Menu Buttons.                                                 
 
 
 
Please check the above solution and let us know if it is helpful.  

Regards, 
Venkateshwaran V.R. 



Loader.
Up arrow icon