Which component for highlighting part of item/string lazarus / 31-LCL ---------------------------------------------------------------------- user2126296 · 2013-03-20 12:12 Which component (TListView, TStringGrid, ...) do you recommend for this: presentation of list itemsitems will be stringsspecified substrings (e.g. words) will be highlighted - I need to highlight some words in a string/item.Example: http://www.codeproject.com/Articles/103259/Highlight-Searched-Text-in- WPF-ListView I am not aware of a way to change background color for a part of string (using OnCustomDrawItem). ---------------------------------------------------------------------- Blaazen · 2013-03-20 12:56 TSynEdit (or TSynMemo) ---------------------------------------------------------------------- user2126296 · 2013-03-20 14:05 Quote from: Blaazen on March 20, 2013, 01:56:40 pmTSynEdit (or TSynMemo)It'd be non-standard usage of TSynMemo because of need to present tabular data: read only row (can be easily implemented in TSynMemo)when onclick on row, full row should be selected (not sure)need to access data/strings in particular column ---------------------------------------------------------------------- Martin_fr · 2013-03-20 15:04 The other option is to do painting yourself. Many components have on Paint, or even OnPaintItem (sorry no example) ---------------------------------------------------------------------- theo · 2013-03-20 16:23 Yes, paint it yourself. Canvas.TextExtent  Canvas.FillRect Canvas.TextOut or TextRect are your friends. ---------------------------------------------------------------------- user2126296 · 2013-03-20 17:22 And which event should be the trigger to do the painting? TListBox, TListView and TStringGrid have only OnDrawItem, no OnPaint(Item) event available. I do not know the difference between OnPaint(Item) and OnDrawItem events. ---------------------------------------------------------------------- theo · 2013-03-21 08:16 Yes, OnDrawItem, OnCustomDraw ... etc. whatever seems appropriate.