I have a tabcontrol and I want to put some tabitem headers aligned to the left, and others aligned to the right. Like in this mock screenshot:
http://img269.imageshack.us/img269/8894/tabcontrol.png
What I’ve tried already:
- Styles: I can right align the tabitem using this:
But I haven’t been able to find a way to mix left and right aligned tab items.
- Using two TabControls: I can have two overlapping TabControls, one with left aligned tabs, the other with Right aligned tabs. The difficulty is getting them to switch. Click or MouseDown don’t fire consistently when the user clicks the tab header (even with Ishitvisible = true). SelectionChanged doesn’t work because if the user has previously selected tab ‘D’ in TabControl 2, then goes to Tab ‘A’ and back to ‘D’ – TabControl 2 doesn’t know the selection has changed.
At this point I am out of ideas.
You could try overwriting the Template for the
TabPanel, however if that doesn’t work you’ll have to overwrite theTabControl.Template. Default control templates can be found hereEdit
Just tested, and
TabPaneldoesn’t have a template you can override, so your best bet would be to overwrite theTabControl.Templateto use your own Panel for hosting TabItems.