Skip to main content

TdxTreeViewCustomDrawEvent Type

The custom draw procedural type for the Tree View control.

Declaration

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