How to remove the small of padding around the ListBoxItem?
Posted
by
Darf Zon
on Stack Overflow
See other posts from Stack Overflow
or by Darf Zon
Published on 2012-03-25T05:10:49Z
Indexed on
2012/03/25
5:30 UTC
Read the original article
Hit count: 233
I'm styling a listBox. i'm trying to clear the margins, so I realized which it, I set the padding of the style to 0 (left padding).
But I can still seeing some margin in it, and I need to have no margin in it? Does you know which would be the problem?
<ListBox ItemsSource="{Binding Partitions}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<Canvas />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="Padding" Value="0"/>
<Setter Property="Canvas.Top">
...
</Setter>
</Style>
</ListBox.ItemContainerStyle>
I mean, I can see an extra space around the item and I can't handle it to modify to 0.
© Stack Overflow or respective owner