You are writing off topic. I wrote that the only thing I'm interested in is adjusting the height of the component in relation to my own calculations — the rest, i.e. the width and position of the component, should not be modified, because they must be managed by LCL (so that the width adjusts automatically, according to the set anchors).
Well, I'm changing the height, the component actually has the height according to the calculations, but in runtime the width of the component does not change at all, despite the fact that the component is anchored to the right edge of the window (when stretching the window, the component maintains a fixed width). In design time it resizes automatically, in runtime it doesn't. No matter if I overwrite ChangeBounds or in the Resize method I calculate a new height and assign it to the component's Height property, the height is always as calculated, but the width is not automatically set by LCL (anchors are ignored).
Anyone know why this is happening and how to force the component to respect these anchors? See attachments:
1.png — design time, standard size
2.png — design time, after stretching window (the component respects anchors)
3.png — runtime, standard size
4.png — runtime, after stretching window (the component maintain its width, it ignores anchors).
My test component is nested in the ScrollBox and is anchored to the left and right of it. ScrollBox is anchored to the left and right of the window. If I change the width of the window, the ScrollBox adjusts its size (respects anchors), but my test component does not adjust the width to the ScrollBox. This problem exists only in runtime. Now it should be clear what is going on.