using System.Drawing;
using System.Drawing.Drawing2D;
using DevExpress.XtraTreeList;
private void treeList1_CustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e) {
// Create brushes for cells.
Brush backBrush, foreBrush;
if (e.Node != (sender as TreeList).FocusedNode)
{
backBrush = e.Cache.GetGradientBrush(e.Bounds, Color.PapayaWhip, Color.PeachPuff, LinearGradientMode.ForwardDiagonal);
foreBrush = Brushes.Black;
}
else
{
backBrush = Brushes.DarkBlue;
foreBrush = e.Cache.GetSolidBrush(Color.PeachPuff);
}
// Fill the background.
e.Cache.FillRectangle(backBrush, e.Bounds);
// Paint the node value.
e.Cache.DrawString(e.CellText, e.Appearance.Font, foreBrush, e.Bounds,
e.Appearance.GetStringFormat());
// Prohibit default painting.
e.Handled = true;
}
Dev TreeList 自定义节点样式
猜你喜欢
转载自blog.csdn.net/sinat_32857543/article/details/103495130
今日推荐
周排行