Frequently Asked Component Specific Questions
Options |
|
Display all FAQ items |
Displaying items 1 to 1 of 1, page 1 of 1
<< previous next >>

TAdvTreeViewHow to change the images for the check boxes and radio buttons
You can change the default drawing by implementing the OnBeforeDrawNodeCheck and then set the allow parameter to False. The default checkbox drawing will be disable, and then you can manually draw a different image, or graphic with the ACanvas parameter, as demonstrated in the sample below:
procedure TForm1.AdvCheckedTreeView1BeforeDrawNodeCheck(Sender: TObject;
ACanvas: TCanvas; ARect: TRectF; AColumn: Integer;
ANode: TAdvTreeViewVirtualNode; var AAllow: Boolean);
begin
AAllow := False;
if ANode.Node.Checked[0] then
// draw checked checkbox
else
// draw unchecked checkbox
end;