ADVListBox and Items text rigth alignment

Good afternoon to all,

there is any way to align the item text to the rigth ?

Thank's for reply



This adds right-aligned text to the TAdvListBox:

  li: TListBoxItem;
 li := advlistbox1.Items.Add;
 li.Text := '<P align="right">right-aligned</p>';

Hi Bruno,

thank's for all.


Any way to have some text left-aligned, but other text right-aligned in a THTMListBox? Like a menu with shortcut keys on the right?

Something along these lines:
<IMG SRC="..."> Text<DIV ALIGN="RIGHT">SizeOfImage</DIV>

where the image and the Text is left-aligned, but the SizeOfImage is right-aligned on the same line.

Also - is it possible to center text vertically? Ie. if the above image is taller than the font height, I would like the text to be vertically centered within the listbox item (and still have some of the text right-aligned).

Keld R. Hansen

Sorry, TAdvListBox can at this moment not handle HTML formatted text, only plain text, so it is unfortunately not possible to have such alignment controlled through HTML tags.
The text is now top-aligned. 
A possible way to introduce HTML support is by replacing in ADVLISTBOX.PAS the declaration 

  TVisualListBox = class(TListBox)


  TVisualListBox = class(THTMListBox)

I'm already using THTMListBox - but I can't make it work with both left- and right-aligned text in the same item...

... Nor can I vertically center the text, if the image on the left is taller than the font height...

Please see the float attribute for left & right alignment and see align attribute for IMG tag

Thanks. That solves the left/right alignment. But not the vertical alignment of the text within the image's height...

Any way to make it look like this:

But how do I combine ALL my requests, ie. an image to the left, with some text (vertically centered in the image height) left-aligned, and - on the same horizontal line - some text right aligned.

ie. something like this (which doesn't work):

<IMG SRC="idx:2" ALIGN="MIDDLE">Text<P ALIGN="RIGHT">Right-Text</P>

which combination of ALIGN, FLOAT and P should be used?
This one doesn't work either:

<IMG SRC="idx:2" ALIGN="MIDDLE"><p align="left" float="left">Left</p><p align="right">Right</p>

It displays the "Left" vertically centered, but the "Right" is top-aligned within the item (ie floats "above" the "Left" text like this:

!----!                                           Right
!     ! Left

The floating right paragraph did not pickup the image alignment. It only applied to regular HTML tags on the same line.

We've extended the HTML rendering code to make the image alignment also reflected on right floating paragraphs. The next update will have this improvement.

Thank you - looking forward to it...