开发者

Adjusting TabItem width automatically to fill spaces?

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

Now I wish to have one of following design:

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

What properties should I set to archieve one of the design above? For the second design, I tried to adjust HorizontalAlignment property (to "center") in TabItem objects and HorizontalContentAglinment property (to "center") in TabControl object, but 开发者_如何转开发neither works.

Could someone point out what should I do to implement the design? I prefer the first design, but if it is impossible or very difficult, the second one would be nice too.

Thanks.


The tabs are arranged by the TabControl's HeaderPanel. You need to replace the HeaderPanel to change the layout. It seems like the only way to do this is with a ControlTemplate. Here is an article that will show you how to do that: http://www.codeproject.com/KB/WPF/WpfSqueezeTabPanel.aspx.


Please see my answer on this similar question(If I understood correctly): How to Stretch WPF Tab Item Headers to Parent Control Width

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜