Hello, as you know "UpdateLayout" at run time does not work correctly on most components. I'm working on this and I see that to work properly "UpdateLayout" by component we would have to put the following lines of code:
lbTest.PosRelativeToAnchor := [];
lbTest.PosRelativeToParent := [rpCenterInParent];
lbTest.ResetAllRules();
lbTest.UpdateLayout();
The problem that "ResetAllRules" is not implemented in all the visual components, so it would be necessary to implement it. And the operation of this function alone does not make any sense, ideally this function should be included in "UpdateLayout" as follows:
procedure jTextView.UpdateLayout();
begin
if FInitialized then
begin
ResetAllRules();
inherited UpdateLayout();
UpdateLParamWidth;
UpdateLParamHeight;
jTextView_setLayoutAll(FjEnv, FjObject , Self.AnchorId);
end;
end;
So we would have a cleaner and more functional code:
lbTest.PosRelativeToAnchor := [];
lbTest.PosRelativeToParent := [rpCenterInParent];
lbTest.UpdateLayout();