If I put tab characters into a string and then assign the Caption property of a label from the string what do the tab characters do?
CR characters cause a return, which is useful for displaying a multi-line caption. Tab characters do seem to perform some sort of tabbing action - I'm wondering if this behaviour is defined or predictable. (I guess the behaviour is determined by Windows, not Delphi).
If you put tab characters in a
TLabel.Caption
, theCaption
contains tab characters.How the tab character is displayed depends on the font you use and Windows itself. A quick test in XE, for instance, on Win7 displays spacing appropriate for tab characters (approximately 8 spaces, in a non-proportional font).
Here's my test. Drop three labels on a form, and add this to the form's OnCreate event:
Here's the output: