How to align the text of a Listbox to the right

S

Sori Schwimmer

For a listbox, I would give a width and go with string
formatting. In your case, I guess that what I'll do is
to limit the width to something acceptable, and show
only the tail of the line.

Say, your width is w, then I'll show only the last w-4
chars, preceded by '... ' (ellipsis+space). It might
be nice to put a label on top of your listbox and
dynamically change it's text attribute to the complete
version of your selection in the listbox, broken in
lines of appropriate length.

Hope this helps,
Sorin Schwimmer

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
 
J

Jarek Zgoda

Sori Schwimmer napisa³(a):
For a listbox, I would give a width and go with string
formatting. In your case, I guess that what I'll do is
to limit the width to something acceptable, and show
only the tail of the line.

Say, your width is w, then I'll show only the last w-4
chars, preceded by '... ' (ellipsis+space). It might
be nice to put a label on top of your listbox and
dynamically change it's text attribute to the complete
version of your selection in the listbox, broken in
lines of appropriate length.

Yeah, but what is the question?
 
L

Leonardo da Vinci

Sori Schwimmer ha scritto:
For a listbox, I would give a width and go with string
formatting. In your case, I guess that what I'll do is
to limit the width to something acceptable, and show
only the tail of the line.

Yes, this is exactly what I wanted to do. Do you know a way to
accomplish that? Because Eric Brunel said it is impossible on a
Listbox.
Thanks to everybody,

L
 
E

Edward Elliott

Leonardo said:
Yes, this is exactly what I wanted to do. Do you know a way to
accomplish that? Because Eric Brunel said it is impossible on a
Listbox.

Use a string slice.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top