开发者

Windows 7 Native Look for .NET ListView

Currently, my ListViews look like this:

Windows 7 Native Look for .NET ListView

How can I ac开发者_JAVA技巧hieve that Windows 7 native look below?

Windows 7 Native Look for .NET ListView


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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜