user8001246
user8001246

Reputation:

WPF TabControl - How to remove Margin above inactive Tabs?

Any Ideas how to remove the Margin in the following image?

Tab Margin Example

Upvotes: 1

Views: 172

Answers (1)

grek40
grek40

Reputation: 13438

Checked it via Snoop. By default, the selected TabItem has a margin of -2,-2,-2,-1, so you can set this top margin for all tab items:

<Style TargetType="{x:Type TabItem}" BasedOn="{StaticResource {x:Type TabItem}}">
    <Setter Property="Margin" Value="0,-2,0,0"/>
</Style>

Upvotes: 3

Related Questions