0

I am using ListBox with dynamically creatable ListBoxItems (Wrap enabled) to display some text. I have a problem to calculate Heigth property of ListBoxItem in code to make sure my string are fully visible in ListBoxItem rectangle. Now I am doing it like this: I am put Label in form (opacy = 0) with autosize = true (a call it measure_Lbl), then I am prepared to create ListBoxtem, I put my text into this Label and read Width property. Then I am divide it by ListBowItem.Width and find some approximate value (may be bigger may be less). But I think there is a better way to do so...?

user2880885
  • 93
  • 2
  • 11
  • Can you get the height of the text item from the style and use that in your calculations? – Mike Sutton Oct 16 '13 at 18:02
  • Not sure I understand what you mean. In mobile applications XE5 where is a very limited abilities to work with styles. Can you be more specific? – user2880885 Oct 17 '13 at 00:21
  • In the style there will be an object which is displaying the text, probably a TText. Use FindStyleResource to find it (you'll need to know the StyleName for it), and you can play with it's properties directly. The hard part, as you say, is finding out how the style is made up. – Mike Sutton Oct 17 '13 at 12:03

0 Answers0