mogmo .NET

C#/XAML/VB6たまにC++についてメモ程度に書いていく。あくまで自分用。責任は取れません。

ListView/ListBoxの要素間の隙間を無くす

ItemContainerStyleでListBoxItemのスタイルのPaddingを0にすればよい。

<ItemsControl.ItemContainerStyle>
	<Style TargetType="{x:Type ListBoxItem}">
		<Setter Property="BorderThickness" Value="1"/>
		<Setter Property="Margin" Value="0"/>
		<Setter Property="Padding" Value="0"/>
	</Style>
</ItemsControl.ItemContainerStyle>