Htmlabel does not autosize since last update

Htmlabel version 2.5.0.1
Drop an Tadvscrollbox in a new vcl project and inside it an Thtmllabel with anchors Left-Right-Top and set Autosize=true
Drop a Tbutton to add content to the Thmlabel and run the project
Only the first line is shown from the Thtmlabel

When you programmatically set a new text, make sure to set AutoSizing = true before setting the text. We made this change to enhance performance.

begin
  htmlabel1.AutoSizing := true;
  htmlabel1.HTMLText.Text := 'Drop an Tadvscrollbox in a new vcl project and inside it an Thtmllabel with anchors Left-Right-Top and set Autosize=true';
end;
1 Like

As far as I can check the following works too, but I need to make a lot of changes now.

htmlabel1.AutoSizing := true;
htmlabel1.HTMLText.BeginUpdate;
htmlabel1.HTMLText.Text := htmlabel1.HTMLText.Text+'Drop an Tadvscrollbox in a new vcl project and inside it ';
htmlabel1.HTMLText.Text := htmlabel1.HTMLText.Text+'an Thtmllabel with anchors Left-Right-Top and set Autosize=true';
HTMLabel1.HTMLText.EndUpdate;

I understand. However, the former approach could cause flickering of the label in specific circumstances, so we had to make a change to avoid this.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.