Windows 7 Native Look for .NET ListView
Currently, my ListViews look like this:
How can I ac开发者_JAVA技巧hieve that Windows 7 native look below?
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);
}
}
精彩评论