Node Image 节点镜像

Goto Nodes 节点

Node Image 节点镜像

节点可以显示以下图标:

  • 选择 Image - 当节点获得/失去焦点时自动切换的两个图标。
  • 状态图像 - 任何自定义图标。

在这里插入图片描述

Select Image 选择图像

Specify image source 指定图像源

TreeList.SelectImageList 属性指定存储图像的有序(索引)集合。您可以使用以下图像集合:

  • ImageList — 管理 Image 对象的集合。

  • ImageCollection — 与 ImageList 类相比,提供了额外的功能。

  • SharedImageCollection — 在多个控件和表单之间共享图像。

  • SvgImageCollection — 存储矢量图像。

Assign images to nodes 将图像分配给节点

要指定特定节点中显示的图像的索引,请使用以下属性和事件:

  • TreeList.ImageIndexFieldName 属性 — 指定包含图像索引的数据字段的名称。该属性指定非聚焦和聚焦状态的图像索引(不能使用数据源字段指定两个图标)。

  • TreeListNode.ImageIndex 和 TreeListNode.SelectImageIndex 属性 — 分别获取或设置处于非聚焦和聚焦状态的节点图像索引。当节点获得/失去焦点时,图像会自动更改。

// Gets the select image index of the focused node.
int selectImageIndex = treeList1.GetFocusedRowCellValue(treeList1.ImageIndexFieldName);
  • TreeList.GetSelectImage 事件 — 在显示节点之前触发,并允许您指定(覆盖)已处理节点的图像索引。

如果索引超出范围,则不会显示任何图像。

Respond to clicks 响应点击

单击选择图像时,将触发 TreeList.RowSelectImageClick 事件。

State Image 状态图像

State image: Specify image source 状态图像:指定图像源

TreeList.StateImageList 属性指定存储图像的有序(索引)集合。您可以使用以下图像集合:

  • ImageList — 管理 Image 对象的集合。
  • ImageCollection — 与 ImageList 类相比,提供了额外的功能。
  • SharedImageCollection — 在多个控件和表单之间共享图像。
  • SvgImageCollection — 存储矢量图像。

State image: Assign images to nodes 状态映像:将映像分配给节点

要指定特定节点中显示的图像的索引,请使用以下属性和事件:

  • TreeListNode.StateImageIndex 属性 — 获取或设置图像索引。

  • TreeList.GetStateImage 事件 — 在显示节点之前触发,并允许您指定(覆盖)已处理节点的图像索引。

如果索引超出范围,则不会显示任何图像。

State image: Respond to clicks 状态图片:响应点击次数

单击状态图像时,将触发 TreeList.RowStateImageClick 事件。

Node Image Location 节点映像位置

使用 TreeList.OptionsView.RowImagesShowMode 属性指定节点图像的显示位置:

  • InIndent — 图像显示在缩进区域中。

在这里插入图片描述

  • InCell — 图像显示在单元格内。

在这里插入图片描述

Draw Node Images 绘制节点图像

TreeList.CustomDrawNodeImages 事件提供对 GDI+/DirectX 绘图表面的访问,并允许您手动绘制节点图标。

有关如何使用绘图表面的更多信息,请参阅自定义绘制方案。

Examples 例子

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值