[WinForm][DevExpress]设置TreeListNode的背景色

时间:2014-06-29 06:19:30   收藏:0   阅读:1156

关键代码:

        /// <summary>
        /// 设置节点背景色
        /// 在NodeCellStyle事件中使用
        /// </summary>
        /// <param name="tree">TreeList</param>
        /// <param name="e">GetCustomNodeCellStyleEventArgs</param>
        /// <param name="builderBackColorHandler">委托</param>
        public static void CustomNodeBackColor(this TreeList tree, GetCustomNodeCellStyleEventArgs e, Func<TreeListNode, Color> builderBackColorHandler)
        {
            TreeListNode _node = e.Node;
            e.Appearance.BackColor = builderBackColorHandler(_node);
        }

代码使用:

bubuko.com,布布扣

代码效果:

bubuko.com,布布扣

[WinForm][DevExpress]设置TreeListNode的背景色,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!