It's even in the FAQ.
BTW. I expected this piece of crucial information to be in the normal docs, where there is no mention of it. Especially because it's different behavior from Delphi.
Fair enough.
I have topics updates that's are pending for 4.0. Let me review what it would take to apply them for 3.8.
I have an update ready that changes ClientHeight, ClientWidth, Height and Width. For example:
TControl.ClientHeight
The height for the client area on the control.
ClientHeight is an Integer property with the number of pixels needed for vertical
client area on the control. The property contains the value from the Bottom
member in ClientRect. Changing the value for ClientHeight causes SetClientSize
to be called to apply the existing ClientWidth and the new value for the property.
The value for ClientHeight is not stored or used to set the Height for the control
during LCL component streaming. It is used, however, when AutoSizing is restored
and when auto-layout policies using Anchors are applied to the control. For example,
when Anchors is set to [akBottom] the value in ClientHeight is needed / used.
In the LCL, ClientHeight has the same value as Height. Derived classes (like
TCustomForm or TForm) may implement a ClientHeight property that differs from Height -
but in the current LCL version, they do not. This differs from the behavior in the Delphi
VCL where a TForm instance adjusts the value in ClientHeight to remove pixels used in
non-client areas like the title bar, borders, frames, and scroll bars. LCL uses this approach
because there is no reliable way to determine the sizes for all of the non-client areas on all
of the platforms where LCL is supported. Without a reliable way, the LCL would needlessly
move the forms around on the screen or resize them endlessly. In the LCL, neither Height
nor ClientHeight include the non-client area on a form instance. The height of a TMainMenu
instance is omitted from both values as well.
Use ClientWidth to access the number of pixels needed for the horizontal client area on the control.
See Also
TControl.ClientRect
TControl.ClientWidth
TControl.Height
TControl.AutoSizing
TControl.EnableAutoSizing
TControl.AutoAdjustLayout
TControl.Resize
TControl.Anchors
I plan to apply it to both fixes_3_0 (for the release in 3.
and in fixes_4.
Feedback appreciated.