码迷,mamicode.com
首页 > 其他好文 > 详细

如何让DevExpress TreeList的每个结点高亮显示?

时间:2014-11-20 06:49:36      阅读:248      评论:0      收藏:0      [点我收藏+]

标签:ar   sp   on   bs   ef   as   new   tt   c   

    概述:如何让DevExpress TreeList的每个节点高亮显示?

如何让DXperience TreeList的每个节点高亮显示?

效果如下:

 
private void treeList1_CustomDrawNodeCell(object sender, DevExpress.XtraTreeList.CustomDrawNodeCellEventArgs e)
 
       {
 
            TreeList node = sender as TreeList;
 
            if(e.Node == node.FocusedNode)
 
            {
 
                e.Graphics.FillRectangle(SystemBrushes.Window, e.Bounds);
 
                Rectangler = new Rectangle(e.EditViewInfo.ContentRect.Left,
                                           e.EditViewInfo.ContentRect.Top,
                                            Convert.ToInt32(e.Graphics.MeasureString(e.CellText,treeList1.Font).Width + 1),
                                            Convert.ToInt32(e.Graphics.MeasureString(e.CellText,treeList1.Font).Height));
 
                e.Graphics.FillRectangle(SystemBrushes.Highlight, r);
 
               e.Graphics.DrawString(e.CellText, treeList1.Font, SystemBrushes.HighlightText, r);
 
                e.Handled = true;
            }
       }

如何让DevExpress TreeList的每个结点高亮显示?

标签:ar   sp   on   bs   ef   as   new   tt   c   

原文地址:http://www.cnblogs.com/goto/p/4109676.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!