02-12-2021, 04:08 PM
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?
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?