So.. working with a treeview..I set the fontstyle of the node based on some database-check done by IsCategory().
This works as expected.. the fontstyle is set just fine.
But when the treeview is shown there is no visual feedback when I select a node.. Events are triggered but I see no selectioncolor, no visual feedback at all.
Now when I replace "if IsCategory(Node.Text)" with something like "if Node.Level = 0" this issue does not occur.
procedure TfrmConfig.tvMainAdvancedCustomDrawItem(Sender: TCustomTreeView;
Node: TTreeNode; State: TCustomDrawState; Stage: TCustomDrawStage;
var PaintImages, DefaultDraw: Boolean);
begin
with tvMain.Canvas do begin
if IsCategory(Node.Text) then
Font.Style := [fsBold]
else
Font.Style := [];
DefaultDraw := true;
end;
end;
function IsCategory(sCategory: string) : boolean;
begin
result := DM.qryEntry.Locate('entryNM;entryCAT', VarArrayOf([sCategory, TRUE]), []);
end;
Any hints?