Since 6.6.0 TLabels with WordWrap are not vertically auto-resized after changing their Width

14 views
Skip to first unread message

mpri...@gmail.com

unread,
Jan 30, 2026, 4:21:04 AM (yesterday) Jan 30
to innosetup
Hello,

Since Inno Setup 6.6.0 (and still present in 6.7.0), when you change Width of TLabel, which has WordWrap := True its Height is not updated (auto-resized) accordingly.

It used to work until 6.5.4.

If you first set Height and only then set the Caption, it works. So I have a workaround and it's not urgent for me.

Code to reproduce the problem:

procedure InitializeWizard();
var
  Caption1, Caption2: TLabel;
begin
  Caption1 := TLabel.Create(WizardForm);
  Caption1.WordWrap := True;
  Caption1.Width := WizardForm.ReadyPage.Width - Caption1.Left;
  Caption1.Caption := 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.';
  Caption1.Left := WizardForm.ReadyLabel.Left;
  Caption1.Top := WizardForm.ReadyLabel.Top + WizardForm.ReadyLabel.Height;
  Caption1.Parent := WizardForm.ReadyLabel.Parent;

  Caption2 := TLabel.Create(WizardForm);
  Caption2.Caption := 'bar';
  Caption2.Left := Caption1.Left;
  Caption2.Top := Caption1.Top + Caption1.Height;
  Caption2.Parent := Caption1.Parent;
end;


bug.png
It seems that the height corresponds to the original (default) width of the label.

Expected behaviour (result of the same code in 6.5.4):
654.png
Thanks.
Martin

Martijn Laan

unread,
Jan 30, 2026, 5:19:24 AM (yesterday) Jan 30
to inno...@googlegroups.com
Hi,

I dont know why TLabel is available, you should not use it. Use TNewStaticText instead. It has an AdjustHeight function you should always call when you're done setting Caption and Width. See the example scripts.

If you don't do that it depends on timing and order of operations what you will see, VCL is very sensitive to that.

Greetings,
Martijn

-------- Original Message --------
--
You received this message because you are subscribed to the Google Groups "innosetup" group.
To unsubscribe from this group and stop receiving emails from it, send an email to innosetup+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/innosetup/ca16cb53-4b76-48ea-b01d-3046d2b0a372n%40googlegroups.com.

mpri...@gmail.com

unread,
Jan 30, 2026, 5:31:51 AM (yesterday) Jan 30
to innosetup
Ok, thanks!
Reply all
Reply to author
Forward
0 new messages