[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