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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM