Automatically adjust TabItem width to fill in spaces?

I have a TabControl object with some TabItem objects inside. Now the TabItem width sum is not long enough to fill the space on the right:

Now I want to have one of the following options:

alt text http://img111.imageshack.us/img111/4158/67279984.png

What properties should I set for archiving one of the projects above? For the second project, I tried to configure the HorizontalAlignment ("center") property in the TabItem objects and the HorizontalContentAglinment property (to the "center") in the TabControl object, but it does not work.

Can someone indicate what I should do to implement the design? I prefer the first design, but if it is impossible or very difficult, the second will also be pleasant.

Thanks.

+4
source share
2 answers

Tabs organized by TabControl HeaderPanel. You need to replace the HeaderPanel to change the layout. It seems that the only way to do this is with the ControlTemplate. Here is an article that will show you how to do this: http://www.codeproject.com/KB/WPF/WpfSqueezeTabPanel.aspx .

+2
source

Please see my answer on this similar question (if I understood correctly): How to stretch the tab of WPF elements in the header for parental control

0
source

All Articles