AdvPolyList Captions

Dear expert!
I use AdvPolyList component to present a list containing Images and Lables.
My problem is with Labels, when they are too long they Wraped down without preserving centered horizontal alignment that I assigned.
For example when I write the followig line by code:
PreviewItem1.caption:= 'Word1 Word2 Word3 Word4 Word5'

I get on the first PreviewItem1 the result:
Word1 Word2 Word3
Word4 Word5

I wish instead getting:

 Word1 Word2 Word3 
    Word4 Word5

Is there a way to handle that? if not Is there a way to access a canvas on the component by code
so I would be able to draw texts as I wish?
Please Help

Can you create them as "HTML Item"s instead ? This way you can use PreviewItem1.caption := '<p align="center">Word1 Word2 Word3 Word4 Word5</p>';

Set PreviewItem.WordWrap = false (and possibly PreviewItem.Ellipsis = true)?

Alternatively, you can also do custom drawing via PreviewItem.OnItemStartDraw()

very nice. Thank you Julio

Thank you I will try that

Hello Julio
I tried your solustion

PreviewItem1.caption := '<p align="center">Word1 Word2 Word3 Word4 Word5</p>';

and indeed got the desired result.
However when I tried to put Words written in arabic (Bidi= RightToLeft) I got the words shuffled!!!
What should I add to inside the caption to fixe this?
Thank you in advance!

At this moment, the HTML formatted text doesn't support right to left sentences

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.