Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove all left padding from WPF ListBox

Tags:

c#

wpf

Each item in a WPF ListBox control seems to have a bit of left padding. How can I restyle to remove all padding?

Default Comparison

like image 891
user38309 Avatar asked Jan 12 '09 16:01

user38309


1 Answers

You can also style the ListBoxItems for a specific ListBox as follows:

<ListBox>     <ListBox.ItemContainerStyle>         <Style TargetType="ListBoxItem">             <Setter Property="Padding" Value="0"/>         </Style>     </ListBox.ItemContainerStyle> </ListBox> 
like image 149
Kent Boogaart Avatar answered Sep 19 '22 01:09

Kent Boogaart