[DevExpress]treeList1背景色设置与自定义图标

为了和系统界面一致改成透明色:

treeList1.BackColor = Color.Transparent;
            treeList1.Appearance.Empty.BackColor = Color.Transparent;
            treeList1.Appearance.Row.BackColor = Color.Transparent;
自定义图标

        private void treeList1_CustomDrawNodeImages(object sender, CustomDrawNodeImagesEventArgs e)
        {
            //0 叶子 1  文件夹   2 打开文件夹
            if (e.Node.Nodes.Count > 0)
            {
                if (e.Node.Expanded)
                {
                    e.SelectImageIndex = 2;
                    return;           
                }
                e.SelectImageIndex = 1;
            }
            else 
            {
                e.SelectImageIndex =0;
            }
        }

你可能感兴趣的:([DevExpress]treeList1背景色设置与自定义图标)