Delphi TcxTreeList 节点添加图片

需要给TcxTreelist的列添加图片,操作如下

1.设置列, 设置Properties为ImageComboBox ,

2. 设置Properties -> Items 添加内容

Delphi  TcxTreeList  节点添加图片

对应的增加相应的图片, value 为将来要填冲的内容, 设置为 ShorInt

Delphi  TcxTreeList  节点添加图片

4. 填充数据的时候, 保证 字段为短整型,

vNode.Values[colR_aaa.ItemIndex] := Ord(FieldByName(aaa).AsBoolean); //已完成

vNode.Values[colR_bbb.ItemIndex] := Ord(FieldByName(bbb).AsBoolean); //已结清

5. 效果

Delphi  TcxTreeList  节点添加图片

6.完善

修改 属性Delphi  TcxTreeList  节点添加图片

这样的效果Delphi  TcxTreeList  节点添加图片

7.完善, 居中, 默认情况下图标的对齐属性只有 ialeft 和 iaRight , 设置ShowDescriptions 设置为false 就能达到效果啦

Delphi  TcxTreeList  节点添加图片