[comp.windows.ms.programmer] Right aligned tabstops in a llistbox?

d89-bfr@sm.luth.se (Bjorn Fahller) (11/07/90)

I want to have a table in a listbox. The table looks someting like

Itemname1	759	  79	7484
Itemname2	 45 	 121	 344
 etc etc etc

I want to have the numbers right aligned, but I'd rather not use a fixed
font. Can this be done? How?
   _
/Bjorn.

spolsky-joel@cs.yale.edu (Joel Spolsky) (11/08/90)

In article <1203@tau.sm.luth.se> d89-bfr@sm.luth.se (Bjorn Fahller) writes:
>
>I want to have a table in a listbox...
>
>I want to have the numbers right aligned, but I'd rather not use a fixed
>font. Can this be done? How?

Use owner draw listboxes, and draw your numbers there yourself, right
justified. 

Joel Spolsky
spolsky@cs.yale.edu                                     Silence = Death

johnte@microsoft.UUCP (John TERRANOVA) (11/10/90)

In article <1203@tau.sm.luth.se> d89-bfr@sm.luth.se (Bjorn Fahller) writes:
>
>I want to have a table in a listbox. The table looks someting like
>
>Itemname1	759	  79	7484
>Itemname2	 45 	 121	 344
> etc etc etc
>
>I want to have the numbers right aligned, but I'd rather not use a fixed
>font. Can this be done? How?

I don't have the details on hand right now, but here is what I
know off the top of my head.

You can give the listbox the OWNERDRAWN style.  This style
causes an application supplied callback routine to be
called to render each item in the list box.  You can then
format the items any way you want.

This may not be the solution you're looking for, but it
should work.

>/Bjorn.

-----------------------+----------------------------+-------------------------
    John Terranova     |  What the Hell do I know?  |  I speak/type for me
johnte@microsoft.uucp  |  I come from Waunakee!     |  and no one else.
-----------------------+----------------------------+-------------------------
"You look so good; you feel good, too.  When they see you shake it, baby
 everybody's gonna pay attention to you and you and you." --Gerard, Shake It