[转] TreeList 当前节点图标和背景色设置
节点 设置 当前 图标 背景色
2023-09-14 09:02:24 时间
// 给TreeList加SelectImage this.treelArea.SelectImageList = imglCustom; // 去掉选中节点时的虚框 this.treelArea.OptionsView.ShowFocusedFrame; // 设置选中时节点的背景色 this.treelArea.Appearance.FocusedCell.BackColor = System.Drawing.Color.LightSteelBlue; this.treelArea.Appearance.FocusedCell.BackColor2 = System.Drawing.Color.SteelBlue; this.treelArea.Appearance.FocusedCell.Options.UseBackColor = true; // 选中时会把节点中没显示完全的信息全部显示 this.treelArea.Appearance.FocusedCell.Options.UseTextOptions = true; this.treelArea.Appearance.FocusedCell.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap; /// <summary> /// Handles the GetSelectImage event of the treelArea control. /// 设置SelectImage的状态,如果是选中的则换成另选中时应该显示的图标 /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e"> instance containing the event data.</param> private void treelArea_GetSelectImage(object sender, DevExpress.XtraTreeList.GetSelectImageEventArgs e) { e.NodeImageIndex = e.Node.Expanded ? 0 : e.Node.Nodes.Count > 0 ? 1 : 2; if (e.FocusedNode) { e.NodeImageIndex += 3; } }
相关文章
- HTMLDOM中三种元素节点、属性节点、文本节点的测试案例
- winform TreeView树节点上下移动
- Java实现 LeetCode 237 删除链表中的节点
- openshift介绍及centos7安装单节点openshift、Redhat安装openshift集群完全教程
- SAP Spartacus B2B Org Unit List节点展开的递归逻辑实现
- Android 10 应用层如何操作设备节点/sys/devices
- 【故障定位】基于粒子群优化算法的故障定位及故障区段研究【IEEE33节点】(Matlab代码实现)
- xml文件的根节点layout_width或者layout_height设置无效果的原因分析
- kubernetes 二进制安装(v1.20.15)(七)加塞一个工作节点
- MongoDB 复制集节点增加移除及节点属性配置
- 剑指 Offer 22. 链表中倒数第k个节点
- 基于粒子群优化算法的最佳方式设置无线传感器节点的位置,以减轻由于任何能量耗尽节点而产生的覆盖空洞(Matlab代码实现)
- Kafka单节点单broker的部署和使用