In a Delphi 10.4.2 32-bit Delphi VCL Application, I have a TLabel set on top of a TCard:
object lblColorTransparencyInfo: TLabel
AlignWithMargins = True
Left = 5
Top = 37
Width = 156
Height = 20
Margins.Left = 5
Margins.Top = 5
Margins.Right = 5
Margins.Bottom = 5
Align = alTop
Caption =
'Pick a color in the image to make that color transparent in the ' +
'whole image'
Color = clInfoBk
ParentColor = False
Transparent = False
WordWrap = True
ExplicitTop = 0
end
Label.Color is set to clInfoBk, so you can visually check the Label's size.
However, despite the Label.AutoSize is set to True, the Label's HEIGHT is much higher than its text height, despite Label.AutoSize = True:
Is this a bug in TLabel.AutoSize?
How can I set the Label Height to its correct text-height? (Please note that the Label's width could dynamically change during run-time which would also dynamically change the text-height at run-time).



