How can I remove the "classic" indented border from around my WPF ListView
control? Setting its BorderThickness
to 0 does not get rid of it.
views:
423answers:
2For a lot of the built-in WPF control styles, you need to override the ControlTemplate to get this level of control over the rendering.
Here is the MSDN page that provides the ListView ControlTemplate, with instructions on how to use it -- basically you are inserting local copies of all the styles for the ListView control, which then override the default control look and feel.
To get rid of the indented border, you will need to find the specific border definition in the control template that is causing the behavior you want to modify; there are several of them, but it should be easy enough to figure out which one is causing the indentation using trial and error and/or Snoop.
Don't know if its a former version of WPF, but on Visual studio 2008 the following is enough to remove all borders and colors of a listview control
<ListView Background="Transparent" BorderThickness="0">