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

Posted 厦门德仔

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[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背景色设置与自定义图标的主要内容,如果未能解决你的问题,请参考以下文章