Results 1 to 4 of 4

Thread: help with listview please!!

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Posts
    103

    Unhappy

    i have added a listview to my form called lsthistory that i want to display data from my sql7 database in.
    i want to display 3 seperate fields of data within my listbox control and be able to add new data this way too???
    can this be done???
    thanks in advance!!!



  2. #2
    Guest
    i put this first code in the form load event
    so the form looks right when it is first seen.

    Code:
        'set up the listview header lstSLines
        With Me
            .lstSLines.ColumnHeaders.Add , , "No Of Pieces"
            .lstSLines.ColumnHeaders.Add , , "Description"
            .lstSLines.ColumnHeaders.Add , , "Weight"
            .lstSLines.ColumnHeaders.Add , , "Class"
            .lstSLines.ColumnHeaders(3).Alignment = lvwColumnRight
            
        End With
    next i run my queries and then fill in the columns:

    Code:
    'fill the lines in the appropriate columns
                    While Not rsSLines.EOF
                    Set iSubItems = lstSLines.ListItems.Add(, , CStr(rsSLines!Pieces))
                        iSubItems.SubItems(1) = CStr(rsSLines!Description)
                        iSubItems.SubItems(2) = CStr(rsSLines!Weight)
                        iSubItems.SubItems(3) = CStr(rsSLines!Class)
                        rsSLines.MoveNext
                    Wend
                    Set iSubItems = Nothing
    i hope it makes a little sense...




  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Posts
    103

    thanks

    i have never used the listview control before.
    i have tried the first part of the code in my form load event. but it does not seem to display my headings in my listview control any ideas why not??

  4. #4
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,657
    There is a property that can be checked on or off, its called something like "HideColumnHeaders" (I don't have VB loaded on this machine at the moment so I can't check the exact name of the property).
    "It's cold gin time again ..."

    Check out my website here.

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