Right now, I have a WPF window where all the tab labels of the TabControl
are centered.
I'd like the tab levels of the TabControl
to be left-aligned.
Is this possible without completely redoing the ControlTemplate
?
I tried messing with HorizontalAlignment
, HorizontalContentAlignment
, etc., but nothing I tried had the desired effect.
If I try this solution (offered by T Levesque):
<TabControl...>
<TabControl.ItemContainerStyle>
<Style TargetType="{x:Type TabItem}">
<Setter Property="HorizontalAlignment" Value="Left"/>
</Style>
</TabControl.ItemContainerStyle>
...
</TabControl>
...I get this:
All the tab labels of the TabControl
are left-aligned, but the tabs don't stretch properly
Which is close, but it ends up looking kind of like a histogram.
Simply adding the attribute HorizontalContentAlignment="Left" to the TabControl will align tab headers left.
<TabControl
Margin="0,5,0,0"
HorizontalContentAlignment="Left"
TabStripPlacement="Left">
<TabItem
Header="Perform System Administration">
...
<TabItem
Header="Perform Setup Tasks">
...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With