Windows 7 Native Look for .NET ListView

别等时光非礼了梦想. 提交于 2019-12-20 06:09:09

问题


Currently, my ListViews look like this:

How can I achieve that Windows 7 native look below?


回答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);
    }
}


来源:https://stackoverflow.com/questions/5086682/windows-7-native-look-for-net-listview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!