vcl-dxtreeview-5fb23363.md
The custom draw procedural type for the Tree View control.
TdxTreeViewCustomDrawEvent = procedure(Sender: TdxCustomTreeView; ACanvas: TcxCanvas; AViewInfo: TdxTreeViewViewInfo; var AHandled: Boolean) of object;
| 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.
|
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;
void __fastcall TForm1::dxTreeViewControl1CustomDraw(TdxCustomTreeView *Sender,
TcxCanvas *ACanvas, TdxTreeViewViewInfo *AViewInfo, bool &AHandled)
{
ACanvas->Brush->Color = clSkyBlue;
ACanvas->FillRect(AViewInfo->Bounds);
}
The Tree View’s OnCustomDraw event references the TdxTreeViewCustomDrawEvent type.
See Also