I have a panel inside another:
The inner panel is aligned alTop
:
And the outer panel is set to AutoSize=true
:
And everything sizes. If i changes the height of the inner panel at design time, the outer panel auto sizes to accommodate it:
And now runtime
Now i need to change the height of the inner panel at runtime:
procedure TForm2.Button1Click(Sender: TObject);
begin
pnlInner.Height := pnlInner.Height + 50;
lblPointer.Top := pnlOuter.Top + pnlInner.Height;
end;
Except when i change the height of the inner panel at runtime, the autosize panel does not autosize:
This of course worked in Delphi 5, 7, and probably XE2 - XE5.
What's the fix?
The workaround is, of course, to bypass Alignment/Autosize and do everything during various OnResize events. But that's distinctly not RAD. I'm sure it's a small bug in the VCL somewhere. And since we already have about two-dozen XE6 VCL bugs that we've patched, it would be better to fix it so nobody else has to think about it.
Bonus Chatter
I love the line:
and, could you please attach sample project?
It's almost as if nobody bothered to even try to reproduce it.
Vcl.Control.pas
up there already; but they have a 512kB limit. – Stealinganchor
for that. – Jonellejonesif Showing then DoAdjustSize
blocks. i picked the wrong one. – Stealing