Results 1 to 3 of 3

Thread: ListView control in VB6 ENT

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2000
    Location
    London
    Posts
    2

    Exclamation

    HI.

    i am developing a form which consists of 1 listview control (the standard MS one) it has 3 columns, and im having trouble spreading the text out on the columns. it all crams into the first column of the row

    i want it like

    Column 1 Column 2 Column 3
    -------------------------------------------------
    value 1 value 2 value 3

    but it comes out like

    Column 1 Column 2 Column 3
    -------------------------------------------------
    value 1value 2value 3

    can anyone help?

    thanks in advance,
    Dan

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    'samle of loading a listview with 3 columns.
    Code:
        Dim l As Long
        Dim dblRnd As Double
        Dim dteRnd As Date
        With ListView1
            ' Add three columns to the list - one for each data type.
            ' Note that the data type is set in the column header's
            ' tag in each case
    '
            .ColumnHeaders.Add(, , "String").Tag = "STRING"
            .ColumnHeaders.Add(, , "Number").Tag = "NUMBER"
            .ColumnHeaders.Add(, , "Date").Tag = "DATE"
    '
            ' Set the column alignment - has no bearing on the sorts.
    '
            .ColumnHeaders(1).Alignment = lvwColumnLeft
            .ColumnHeaders(2).Alignment = lvwColumnRight
            .ColumnHeaders(3).Alignment = lvwColumnCenter
    '
    ' Set BorderStyle property.
       ListView1.BorderStyle = ccFixedSingle
    '
    ' Set View property to Report.
       ListView1.View = lvwReport
    '
            ' Populate the list with data
            With .ListItems
                For l = 1 To 100
                    With .Add(, , "ListItem " & Format(l, "0000"))
                        dblRnd = (Rnd() * 10000) - 5000
                        dteRnd = (Rnd() * 1000) + Date
                        .ListSubItems.Add , , Format(dblRnd, "0.00")
                        .ListSubItems.Add , , Format(dteRnd, _
                        "dd/mm/yyyy")
                    End With
                Next l
            End With
        End With
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2000
    Location
    London
    Posts
    2

    Talking

    THANKS - i would never have known what to do!

    Dan

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