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

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/david_520042/article/details/50716251

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

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;
            }
        }

展开阅读全文

没有更多推荐了,返回首页