C#的Windows7 / Vista的风格的ListView [英] C# Windows7/Vista style ListView

查看:950
本文介绍了C#的Windows7 / Vista的风格的ListView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我创建一个ListView详细在VS2008中查看,它会创建一个相当老看列表视图。它没有任何花哨的悬停效果和冷静的蓝色边框(例如)在WinVista和Win7文件资源管理器了。例如,见图片:

when I create a ListView in details view in VS2008, it creates a rather old looking listview. It doesnt have any of the fancy hover effects and cool blue border that (for example) the file explorer in WinVista and Win7 has. See image for example:

总结一下,我怎样才能在C#中VS2008看起来像一个在上面的图片一个ListView? (VS2008列表视图上比较合适)

So to summarise, how can I get a ListView in C# VS2008 look like the one in the picture above? (VS2008 listview on the right for comparison)

感谢

推荐答案

尝试调用的 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);
   } 

这篇关于C#的Windows7 / Vista的风格的ListView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆