TreeNode with caption containing "Tab" character lazarus / 31-LCL ---------------------------------------------------------------------- flowCRANE · 2024-01-25 13:50 I wanted the nodes in the TTreeView control to have a caption containing a numeric font ID, then a horizontal tab, followed by the font name. Thanks to the tabulator, font names would be aligned and thus more readable. Unfortunately, from what I can see, the tab character is ignored, in addition, not only when it comes to tree nodes, but also other controls (e.g. TButton). 1. Is there any specific reason why the horizontal tab character is ignored when rendering text in standard controls? 2. Is there any way to force the horizontal tab to be respected and thus have the caption auto-aligned in TTreeNode (and other standard controls)? Of course other than manually rendering node content or making wider spaces using space characters. ---------------------------------------------------------------------- Zvoni · 2024-01-25 15:52 At a guess: because the Caption itself doesn't know where the Tab-Stop is. A Tab is usually a (predefined) sequence of spaces. Say 1 Tab = 4 Spaces IIRC, in the Lazarus-IDe you can change the "width" of a Tab (say, from 4 to 8, or whatever) That said: From where is the Caption going to know how many "spaces" to jump forward? ---------------------------------------------------------------------- flowCRANE · 2024-01-25 16:22 For example, in Win32 interface, if the control caption is rendered using the DrawText function, it can contain tab characters and they will be expanded if the DT_EXPANDTABS flag is used. The caption of the TLabel control is rendered using this flag, thanks to which labels can contain tabulators and have adjustable text. But for some reason, text in controls of other types is either not rendered using this function or the mentioned flag is not used.