Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What is the width of the text?
#1
Hello.

I would sometimes like to dynamically set the size of the TIWListbox.

I was able to calculate the height of the ListBox1:
MyHeight  :=  round(ListBox1.Items.Count * (ListBox1.Font.Size * ListBox1.Font.PixelsPerInch/72)) +  ListBox1.Items.Count * 3;

I don't know how to calculate the width. In Delphi, canvas is used for this. But TIWListbox has no canvas.
How to calculate the width of any any row of a ListBox1?
Reply


Messages In This Thread
What is the width of the text? - by I.Igor - 02-12-2021, 04:08 PM
RE: What is the width of the text? - by kudzu - 02-12-2021, 07:54 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)