Click here to Skip to main content
14,492,338 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi All ,


I have a list of objects (Say 'Foo' objects) which is set as the ItemsSource of a TabControl. What I need to do is to hide the header of the first tab inside this tab control.
What's the best way to accomplish this?

This can perhaps be achieved by setting a style for a TabItem but how do I specify that only the first Tab's header is to be collapsed whereas the remaining Tabs header should be left as is.

Thanks for any help
Posted

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Hello Hellraiser123

You can select the first TabItem of the TabControl and set it's visibility to "collapsed".
The result of this would be that the TabControl just ignores the first TabItem while it displays the others.

The code looks like the following:
((TabItem)tabCtrl.Items[0]).Visibility = System.Windows.Visibility.Collapsed; 


Where tabCtrl is the name of your TabControl.
   
Comments
aihua1 25-Oct-16 6:31am
   
Cann't convert string to TabItem!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100