zoukankan      html  css  js  c++  java
  • 如何让DevExpress TreeList的每个结点高亮显示?

        概述:如何让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;
                }
           }

  • 相关阅读:
    Git学习笔记(一)
    sql复制表结构及复制表数据
    C#连接Oracle数据库查询数据
    ExcelHelper.cs
    MongoHelper.cs
    Accesshelper.cs
    Android_布局属性大全
    [WinForm]Dundas Chart控件学习(附源码)
    [Android]Adb connection Error:远程主机强迫关闭了一个现有的连接
    html to openxml
  • 原文地址:https://www.cnblogs.com/goto/p/4109676.html
Copyright © 2011-2022 走看看