Results 1 to 8 of 8
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Align VALUE i n column of listview (6.0)

    Huge picture shrunk by HansV

    I use this code to set column in listview.
    But i want to align the value in column UTILIZ and ACCORD to the right..
    Not the title in column header but the text in column;-)
    sorry for stupid question
    Public Sub setUpListView()

    Dim clmHdr As ColumnHeader

    Set clmHdr = ListView1.ColumnHeaders. _
    Add(, , "COPE", 1000, lvwColumnLeft)
    Set clmHdr = ListView1.ColumnHeaders. _
    Add(, , "TIPO", 2000, lvwColumnLeft)
    Set clmHdr = ListView1.ColumnHeaders. _
    Add(, , "FIDO", 600, lvwColumnCenter)
    Set clmHdr = ListView1.ColumnHeaders. _
    Add(, , "UTILIZ", 1600, lvwColumnLeft)
    Set clmHdr = ListView1.ColumnHeaders. _
    Add(, , "ACCORD", 1600, lvwColumnLeft)
    Set clmHdr = ListView1.ColumnHeaders. _
    Add(, , "SCAD", 1000, lvwColumnLeft)
    Set clmHdr = ListView1.ColumnHeaders. _
    Add(, , "", 0)
    ListView1.View = lvwReport

    End Sub

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Align VALUE i n column of listview (6.0)

    Use lvwColumnRight instead of lvwColumnLeft; this applies to both the column header AND the data in the column.

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Align VALUE i n column of listview (6.0)

    OK TKS.
    But i want to maintain the header name columun to the left(?!)

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Align VALUE i n column of listview (6.0)

    I don't think that's possible.

  5. #5
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Align VALUE i n column of listview (6.0)

    hummmmmmmmm..... <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Align VALUE i n column of listview (6.0)

    See for example here.

  7. #7
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Align VALUE i n column of listview (6.0)

    google "imperium":

    The easiest way is to do it in design.

    Right click on the ListView, click properties.

    Click the Column Headers tab

    Click the index button until the column name desired is display.

    Click on the Alignment dropdown combo and select 1 - lvwColumnRight

    is correct?

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Align VALUE i n column of listview (6.0)

    If the columns are fixed, the easiest way to specify them (including the alignment) is in design.

Posting Permissions

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