Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ListBox margin is not the same in Windows 7 and Windows 8

I have styled an WPF ListBox. I'm developing under Windows 8. After setup the style to be as follows (see image), when I test the application in Windows 7, the margin is not the same. As you can see in the imagen the separation between nodes is 1px in Windows 8, but 0 px in Windows 7.

enter image description here

Do you know why is this, and how to solve it?

Thanks in advance.

like image 595
Daniel Peñalba Avatar asked Feb 15 '13 17:02

Daniel Peñalba


1 Answers

I actually managed to get rid of it myself, it looks like it's ListViewItem style that's being changed by Windows8, adding a style to the local resources of the ListView has worked for me.

    <ListView.Resources>
        <Style TargetType="ListViewItem">
            <Setter Property="Margin" Value="0"/>
            <Setter Property="Padding" Value="0"/>
            <Setter Property="BorderThickness" Value="0"/>
        </Style>
    </ListView.Resources>
like image 142
Andy Avatar answered Nov 13 '22 00:11

Andy