C#Windows7/Vista风格ListView

Ozz*_*zzy 9 c# listview windows-vista windows-7 winforms

当我在VS2008的详细信息视图中创建ListView时,它会创建一个相当古老的列表视图.它没有任何花哨的悬停效果和酷蓝色边框(例如)WinVista和Win7中的文件浏览器.见图片例如: 替代文字

总而言之,我怎样才能在C#VS2008中获得一个ListView,如上图所示?(VS2008右侧列表视图进行比较)

谢谢

GvS*_*GvS 14

尝试调用SetWindowTheme

像这样:

    [DllImport("uxtheme.dll", ExactSpelling=true, CharSet=CharSet.Unicode)]
    private static extern int SetWindowTheme(IntPtr hwnd, string pszSubAppName, string pszSubIdList);

   // The constructor:
   public MyForm() {
      SetWindowTheme(this.listView1.Handle, "Explorer", null);
   } 
Run Code Online (Sandbox Code Playgroud)