目前,我的ListViews看起来像这样:
如何在下面实现Windows 7本机外观?
答案 0 :(得分:1)
这回答:How to get Windows native look for the .NET TreeView?
给定的解决方案适用于ListView和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);
}
}