Jump to content

How to force wrap text in Panel.Caption?


rgreat

Recommended Posts

19 minutes ago, rgreat said:

Both approaches do not work.

Why do you need this?

One possible solution I think:

procedure TMainForm.UniFormReady(Sender: TObject);
begin
  with UniPanel1 do
  begin
    Caption := 'this is first line<br>this is second line';
    JSInterface.JSCode('Ext.get('#1'.id+"_td").setHtml("'+ Caption +'");');
  end;
end;

 

  • Like 1
Link to comment
Share on other sites

I need multiline caption to be positioned strictly by design.

Automatic word wrapping is done on wrong world.

I need <br> after comma here:

image.png

Below task is done by using TWO TUniLabels, which cause problems when i modify font size.

image.png

Link to comment
Share on other sites

22 minutes ago, Sherzod said:

Why do you need this?

One possible solution I think:


procedure TMainForm.UniFormReady(Sender: TObject);
begin
  with UniPanel1 do
  begin
    Caption := 'this is first line<br>this is second line';
    JSInterface.JSCode('Ext.get('#1'.id+"_td").setHtml("'+ Caption +'");');
  end;
end;

 

UniPanel1.JSInterface.JSCode('Ext.get('#1'.id+"_td").setHtml("'+UniPanel1.Caption+'");');

Error:

Cannot read property 'setHtml' of null

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...