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

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

1             treeList1.BackColor = Color.Transparent;
2             treeList1.Appearance.Empty.BackColor = Color.Transparent;
3             treeList1.Appearance.Row.BackColor = Color.Transparent;
4         

自定义图标

 1   private void treeList1_CustomDrawNodeImages(object sender, CustomDrawNodeImagesEventArgs e)
 2         {
 3             //0 叶子 1  文件夹   2 打开文件夹
 4             if (e.Node.Nodes.Count > 0)
 5             {
 6                 if (e.Node.Expanded)
 7                 {
 8                     e.SelectImageIndex = 2;
 9                     return;           
10                 }
11                 e.SelectImageIndex = 1;
12             }
13             else 
14             {
15                 e.SelectImageIndex =0;
16             }
17         }

 

posted @ 2019-07-24 09:26  未风  阅读(1417)  评论(0)    收藏  举报