AdvancedCustomDrawItem lazarus / 31-LCL ---------------------------------------------------------------------- kellemes · 2013-04-25 19:37 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. Code: [Select]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;                        Code: [Select]function IsCategory(sCategory: string) : boolean; begin   result := DM.qryEntry.Locate('entryNM;entryCAT', VarArrayOf([sCategory, TRUE]), []); end; Any hints? ---------------------------------------------------------------------- Graeme · 2013-04-26 09:27 You are doing "advanced custom drawing", so it is up to you to do ALL the drawing. Normally that includes looking at the State parameter and adjusting your painting code to suit. Though I do see you set DefaultDraw, so maybe there is another bug in LCL? Can you test with other platforms or widgetsets to see if it is only affected in whatever LCL widgetset you use.