6
我在设计一个listBox。我试图清除边距,所以我意识到它,我将样式的填充设置为0(左填充)。如何去除ListBoxItem周围的小填充?
但我仍然可以看到它的一些边际,我需要没有余量呢?你知道哪个是问题吗?
<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>
我的意思是,我可以看到周围的项目额外的空间,我不能处理它修改为0
什么是您的完整代码?我插入到一个基本的网格,并没有得到这个问题 – 2012-03-25 05:16:12
可能[重复](http://stackoverflow.com/questions/1351605/where-are-the-margins-padding-set-on-a-wpf-listview -网格视图)。看到问题中的第二个答案。 – NVM 2012-03-25 05:52:35