Skip to main content

TdxTreeViewCustomDrawNodeEvent Type

The custom draw procedural type for tree nodes.

Declaration

TdxTreeViewCustomDrawNodeEvent = procedure(Sender: TdxCustomTreeView; ACanvas: TcxCanvas; ANodeViewInfo: TdxTreeViewNodeViewInfo; var AHandled: Boolean) of object;

Parameters

Name Type Description
Sender TdxCustomTreeView

The Tree View control that raised a custom draw event for a node.

ACanvas TcxCanvas

The Sender Tree View control’s canvas.

ANodeViewInfo TdxTreeViewNodeViewInfo

ViewInfo information on the drawn tree node.

AHandled Boolean

Assign True to this property to override the built-in node draw routine. Do not change this parameter value if you only need to add custom draw operations to the built-in routine.

Remarks

The following OnCustomDrawNode event handler applies the italic font attribute to a selected node’s caption:

procedure TForm1.dxTreeViewControl1CustomDrawNode(Sender: TdxCustomTreeView;
  ACanvas: TcxCanvas; ANodeViewInfo: TdxTreeViewNodeViewInfo;
  var AHandled: Boolean);
begin
  if ANodeViewInfo.Node.Selected then
    ACanvas.Font.Style := ACanvas.Font.Style + [fsItalic];
end;

Italic Font

The Tree View’s OnCustomDrawNode event references the TdxTreeViewCustomDrawNodeEvent type.

See Also