2011-02-23 12 views

答えて

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); 
    } 
} 
関連する問題