JDDEV Posted February 11, 2021 Share Posted February 11, 2021 Hi all, I have an uniLabel with AutoSize=True and textConversion=txtHTML The default height is 23 and at runtime i put Caption:='Line1<br>Line2'; The height is still 23. I hoped 46 ! Does exist a function to get the height of a Html text ? Thank you. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 11, 2021 Share Posted February 11, 2021 Hi, 5 hours ago, JDDEV said: The height is still 23. I hoped 46 ! 5 hours ago, JDDEV said: Does exist a function to get the height of a Html text ? Sorry, for what purpose? Quote Link to comment Share on other sites More sharing options...
JDDEV Posted February 12, 2021 Author Share Posted February 12, 2021 The UniLabel has got an UniSimplePanel for parent. The UniLabel is align on top to the UniSimplePanel. At run time when i change UniLabel.Caption (with html tags), i would like to autosize UniSimplePanel synchronized with the new Unilabel content height. Quote Link to comment Share on other sites More sharing options...
JDDEV Posted October 13, 2022 Author Share Posted October 13, 2022 On 2/12/2021 at 8:51 AM, JDDEV said: The UniLabel has got an UniSimplePanel for parent. The UniLabel is align on top to the UniSimplePanel. At run time when i change UniLabel.Caption (with html tags), i would like to autosize UniSimplePanel synchronized with the new Unilabel content height. No solution for that ? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 13, 2022 Share Posted October 13, 2022 On 2/12/2021 at 12:51 PM, JDDEV said: At run time when i change UniLabel.Caption (with html tags), i would like to autosize UniSimplePanel synchronized with the new Unilabel content height. Hello, On the server side? Quote Link to comment Share on other sites More sharing options...
JDDEV Posted October 13, 2022 Author Share Posted October 13, 2022 Yes on the server side. Quote Link to comment Share on other sites More sharing options...
JDDEV Posted October 13, 2022 Author Share Posted October 13, 2022 It is to optimize a custom message form size Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 13, 2022 Share Posted October 13, 2022 18 minutes ago, JDDEV said: Yes on the server side. You can try this approach: 1. UniLabel1.ClientEvents.ExtEvents -> function resize(sender, width, height, oldWidth, oldHeight, eOpts) { ajaxRequest(sender, '_change', {height: height}) } 2. UniLabel -> OnAjaxEvent procedure TMainForm.UniLabel1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName = '_change' then (Sender as TUniLabel).Height := Params.Values['height'].ToInteger end; Quote Link to comment Share on other sites More sharing options...
JDDEV Posted October 13, 2022 Author Share Posted October 13, 2022 Thank you, that is working fine 🤩 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.