0

Currently, my ListViews look like this:

enter image description here

How can I achieve that Windows 7 native look below?

enter image description here

Jeff
  • 908
  • 2
  • 9
  • 23

1 Answers1

1

This was answered here: How to get Windows native look for the .NET TreeView?

The given solution works for both for the ListView and the TreeView.

public class NativeListView : System.Windows.Forms.ListView
{
    [DllImport("uxtheme.dll", CharSet = CharSet.Unicode)]
    private extern static int SetWindowTheme(IntPtr hWnd, string pszSubAppName,
                                        string pszSubIdList);

    protected override void CreateHandle()
    {
        base.CreateHandle();

        SetWindowTheme(this.Handle, "explorer", null);
    }
}
Community
  • 1
  • 1