C# Windows7/Vista style ListView

前端 未结 2 1544
你的背包
你的背包 2021-01-02 09:47

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 ex

2条回答
  •  情书的邮戳
    2021-01-02 10:33

    Try calling SetWindowTheme

    Like this:

        [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);
       } 
    

提交回复
热议问题