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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...