目前,我的ListViews如下所示:

如何实现下面Windows 7本机外观?

发布于 2011-02-28 03:43:22
回答如下: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);
}
}https://stackoverflow.com/questions/5086682
复制相似问题