vcl-dxtreeview-a94b0921.md
The custom draw procedural type for tree nodes.
TdxTreeViewCustomDrawNodeEvent = procedure(Sender: TdxCustomTreeView; ACanvas: TcxCanvas; ANodeViewInfo: TdxTreeViewNodeViewInfo; var AHandled: Boolean) of object;
| 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.
|
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;
void __fastcall TForm1::dxTreeViewControl1CustomDrawNode(TdxCustomTreeView *Sender,
TcxCanvas *ACanvas, TdxTreeViewNodeViewInfo *ANodeViewInfo, bool &AHandled)
{
if (ANodeViewInfo->Node->Selected)
ACanvas->Font->Style = ACanvas->Font->Style << fsItalic;
}
The Tree View’s OnCustomDrawNode event references the TdxTreeViewCustomDrawNodeEvent type.
See Also