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

TdxTreeViewCustomDrawEvent Type

The custom draw procedural type for the Tree View control.

#Declaration

Delphi
TdxTreeViewCustomDrawEvent = procedure(Sender: TdxCustomTreeView; ACanvas: TcxCanvas; AViewInfo: TdxTreeViewViewInfo; var AHandled: Boolean) of object;

#Parameters

Name Type Description
Sender TdxCustomTreeView

The Tree View control that raised a custom draw event.

ACanvas TcxCanvas

The Sender Tree View control’s canvas.

AViewInfo TdxTreeViewViewInfo

The Tree View control’s ViewInfo information.

AHandled Boolean

Assign True to this parameter if you override the Tree View control’s built-in draw routine. Do not change the parameter value if you only need to complement the built-in draw routine with custom draw operations.

#Remarks

The following OnCustomDraw event handler changes the default background color of the Tree View to blue:

procedure TForm1.dxTreeViewControl1CustomDraw(Sender: TdxCustomTreeView;
  ACanvas: TcxCanvas; AViewInfo: TdxTreeViewViewInfo; var AHandled: Boolean);
begin
  ACanvas.Brush.Color := clSkyBlue;
  ACanvas.FillRect(AViewInfo.Bounds);
end;

Blue Background

The Tree View’s OnCustomDraw event references the TdxTreeViewCustomDrawEvent type.

See Also