0

I want tot use only pictures in the header of the tabcontrol. I'm using like this:

<TabItem.Header>
   <Image Name="ImageClientPoints"  Width="150" Height="80"
          Stretch="Fill" Margin="0,0,0,0" />
</TabItem.Header>

and the result is the following:

http://oi39.tinypic.com/x3hnc9.jpg

but I want only the picture without the grey content around the picture.

I'm new to wpf i read about it and as I know I have to create a datatemplate for this but it's to hard to me yet, an example would be helpful.

4

1 回答 1

1

你快到了。似乎标头保留了某种填充。所以set the margin value to some negative value要重叠那个填充空间。

这会为你做 -

<TabItem.Header>
   <Image Name="ImageClientPoints"  Width="150" Height="80"
          Stretch="Fill" Margin="-5" />
</TabItem.Header>

或者

<TabItem.HeaderTemplate>
   <DataTemplate>
      <Image Name="ImageClientPoints"  Width="150" Height="80"
             Stretch="Fill" Margin="-5" />
   </DataTemplate>
</TabItem.HeaderTemplate>
于 2013-10-20T14:02:14.690 回答