Click to See Complete Forum and Search --> : Formatting ListBox Entries


Dan
09-03-2000, 09:10 AM
I'm loading entries into a list box that entails several different columns
from an Access db table. Going thru all kinds of gyrations attempting to
align the columns w/ the column title at the top(label outside the list box).
Using concatenation of spaces (" "), character arrays which have received
conversion of numbers from itoa/gcvt functions, and CString variables directly
from the db table. Getting something to work for the most part, but seems
like there should be an easier way!!! Looking for something like a struct
perhaps that will allow loading the variables into a predefined layout and
using that layout as the AddString arguement,but cannot get that to work
either. Also, cannot get the numeric data (received via the itoa or gcvt
functions into character arrays) to format correctly when the values or >
9, etc. Trying to get a concatenation of spaces to the char array to work,but
no luck. This is VC++ 4.0. Trying to maintain use of the preloaded list box
control to allow cross compile to Mac. If this approach is the accepted solution,
I can work something out, just thought I'd check to see if there is a better
solution to minimize 'spinning the wheels'. Thanks in advance.

Chris
09-05-2000, 11:42 AM
Dan,
Don't use spaces to try and align columns. Use a tab character between columns.
That should give you the result you're looking for.

// CHRIS


"Dan" <magnolia@aug.com> wrote:
>
>I'm loading entries into a list box that entails several different columns
>from an Access db table. Going thru all kinds of gyrations attempting to
>align the columns w/ the column title at the top(label outside the list
box).
>Using concatenation of spaces (" "), character arrays which have received
>conversion of numbers from itoa/gcvt functions, and CString variables directly
>from the db table. Getting something to work for the most part, but seems
>like there should be an easier way!!! Looking for something like a struct
>perhaps that will allow loading the variables into a predefined layout and
>using that layout as the AddString arguement,but cannot get that to work
>either. Also, cannot get the numeric data (received via the itoa or gcvt
>functions into character arrays) to format correctly when the values or
>
>9, etc. Trying to get a concatenation of spaces to the char array to work,but
>no luck. This is VC++ 4.0. Trying to maintain use of the preloaded list
box
>control to allow cross compile to Mac. If this approach is the accepted
solution,
>I can work something out, just thought I'd check to see if there is a better
>solution to minimize 'spinning the wheels'. Thanks in advance.

>
>