(Sorry for the long phrases - I use Google translator)
I thought that the absolute size is not important (and did not return to the original one), and it is only important to check that resizing does not work correctly with certain TLabel properties, but in the same conditions it works correctly for other components (TMemo).
I checked whether the size changes at all, it does not matter from which to which, but whether the expected change is going at all.
but the same problem in design time - as soon as I set autosize = false, wordwrap = true and akLeft + akRight - I can no longer resize TLabel on the form.
but it’s worth removing wordwrap (in designtime) - and everything changes normally (in designtime).
and this is only with tlabel (well, and with tdbtext and other from TCustomLabel), all other components are normal.
I changed the code to resize it from the original - this did not help.
I also added .update - it didn’t help:
var
oldW: Integer;
begin
oldW := Label1.Width;
Label1.Anchors := [akLeft,akRight];
Label1.AutoSize := false;
Label1.WordWrap := true;
Label1.Width := oldW * 2;
Label1.Update;
if Label1.Width = oldW then
ShowMessage('label: anchors with wordwrap - failed')
else
ShowMessage('label: anchors with wordwrap - ok');
Label1.Width := oldW;
Label1.WordWrap := false;
Label1.Width := oldW * 2;
Label1.Update;
if Label1.Width = oldW then
ShowMessage('label: anchors wo wordwrap - failed')
else
ShowMessage('label: anchors wo wordwrap - ok');
end;
label: anchors with wordwrap - failed
label: anchors wo wordwrap - ok
That is, even in designtime we can check: two TLabels on the form (label1, label2), set akLeft and akRight for both labels, autosize = false for both labels and wordwrap = true for label1, wordwrap = false for label2.
then I try to change the width value for both in the OI - where wordwrap = true it does not change.
and only on TLabels (and TDBText), on all other components without problems..