The TreeView control is similar to the utorrent element

In uTorrent 2.2, when the node tree is selected, node has a similar button look. This makes the treeview.NET control so inadequate for me. Now I know that utorrent is written in C ++, but does anyone know how they could do this, or does anyone know that there will be enough libraries?

alt text

+3
source share
1 answer

TreeView Windows Win7 "Explorer". , . , . . .

using System;
using System.Windows.Forms;
using System.Runtime.InteropServices;

class MyTreeView : TreeView {
    protected override void OnHandleCreated(EventArgs e) {
        if (Environment.OSVersion.Version.Major >= 6) {
            SetWindowTheme(this.Handle, "Explorer", null);
        }
        base.OnHandleCreated(e);
    }
    [DllImportAttribute("uxtheme.dll", CharSet = CharSet.Auto)]
    private static extern int SetWindowTheme(IntPtr hWnd, string appname, string idlist);
}

WPF, WindowsFormHost.

+4

Source: https://habr.com/ru/post/1779265/


All Articles