Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TdxTreeViewCustomDrawNodeEvent Type

The custom draw procedural type for tree nodes.

#Declaration

Delphi
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