Results 1 to 3 of 3

Thread: Listview subitems hilight and colored

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 1999
    Location
    San Diego, Ca , USA
    Posts
    44

    Post

    Hello everyone,

    I got the following code from vb help, How can I hilight and make the colomn itmX.SubItems(1) = CStr(myRs!Au_id) in different color like blue? Thanks for your help in advance.


    While Not myRs.EOF
    Set itmX = ListView1.ListItems. _
    Add(, , CStr(myRs!Author)) ' Author.
    ' If the AuthorID field is not null, then set ' SubItem 1 to it.
    If Not IsNull(myRs!Au_id) Then itmX.SubItems(1) = CStr(myRs!Au_id)
    End If ' If the birth field is not Null, set ' SubItem 2 to it.
    If Not IsNull(myRs![Year Born]) Then
    itmX.SubItems(2) = myRs![Year Born] End If
    myRs.MoveNext ' Move to next record. Wend

  2. #2
    Lively Member
    Join Date
    Jun 1999
    Location
    Raleigh, NC
    Posts
    70

    Post

    I don't believe there is any way to color a column/subitem in a list view.... however, for an excellent discussion of adding features to list views, check out this web site http://www.mvps.org/vbnet/
    They talk about adding features to list views like sorting by clicking on columnheaders, dragging columns to new locations, etc.

    Hope this helps
    Bash

  3. #3

    Thread Starter
    Member
    Join Date
    Mar 1999
    Location
    San Diego, Ca , USA
    Posts
    44

    Post

    thanks bashfirst for your respond. I got the answer after experimenting alot in listview. here is my answer:
    Dim itmX As ListItem
    itmX.ListSubItems(1).ForeColor = &HFF&

    ------------------

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