rgreat Posted April 15, 2020 Share Posted April 15, 2020 Caption:='this is first line<br>this is second line'; Caption:='this is first line'#13#10'this is second line'; Both approaches do not work. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 15, 2020 Share Posted April 15, 2020 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; 1 Quote Link to comment Share on other sites More sharing options...
rgreat Posted April 15, 2020 Author Share Posted April 15, 2020 I need multiline caption to be positioned strictly by design. Automatic word wrapping is done on wrong world. I need <br> after comma here: Below task is done by using TWO TUniLabels, which cause problems when i modify font size. Quote Link to comment Share on other sites More sharing options...
rgreat Posted April 15, 2020 Author Share Posted April 15, 2020 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 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 15, 2020 Share Posted April 15, 2020 2 minutes ago, rgreat said: Error: Cannot read property 'setHtml' of null Where do you use this code? 1 Quote Link to comment Share on other sites More sharing options...
rgreat Posted April 15, 2020 Author Share Posted April 15, 2020 UniFormCreate Moved to UniFormShow and it's work. Thank you! 1 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 15, 2020 Share Posted April 15, 2020 27 minutes ago, Sherzod said: procedure TMainForm.UniFormReady(Sender: TObject); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.