Results 1 to 6 of 6

Thread: Listview justification

  1. #1

    Thread Starter
    Fanatic Member Stevie's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    565

    Question

    Can somebody tell me if it possible to have different columns in a listview with different justifications.

    eg:

    Column 1 is for Surnames so it should be left justified.
    Column 2 is for Wage so it should be right justified.

    Is it possible?


  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    yes, set the alignment property for each column!
    Mark
    -------------------

  3. #3

    Thread Starter
    Fanatic Member Stevie's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    565
    Cheers but, thats no good to me because my listview has a different number of columns (and different data types in them) depending on certain conditions, so I really need to do it with code.

    Also if you set the alignments, the column headers are aligned that way as well. Can it be done so that the columns are aligned but not the headers?

    [Edited by Stevie on 05-24-2000 at 04:32 PM]

  4. #4
    Addicted Member
    Join Date
    Mar 2000
    Posts
    168
    In your code when you decide what alignment you want, use this code.. set the lvwColumnRight to left or center, whichever is needed.

    ListView1.ColumnHeaders(1).Alignment = lvwColumnRight

    Thai

  5. #5
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744
    Except the first column. The first column will always be left justified. This is by Micro$oft design.

  6. #6

    Thread Starter
    Fanatic Member Stevie's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    565
    Cheers, I didn't think of looking under ColumnHeaders as I presumed they only refered to the headings.

    So is there anyway to have the headings a different justification to the column?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width