Results 1 to 3 of 3

Thread: [RESOLVED] Listview colours

  1. #1

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Resolved [RESOLVED] Listview colours

    In a listview in report mode how do I change the text colour of a listitem and all its subitems?

    Also, is it possible to have different colors for different subitems?
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  2. #2
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    6,747

    Re: Listview colours

    http://p2p.wrox.com/pro-vb-6/5177-ch...tml#post196225
    Code:
    Private Sub Command1_Click()
        Dim item As ListItem
        ListView1.ListItems.Clear
        Set item = ListView1.ListItems.Add(Text:="Bill")
        item.ForeColor = vbGreen
        item.SubItems(1) = "Gates"
        item.ListSubItems(1).ForeColor = vbRed
    End Sub

  3. #3

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: Listview colours

    Quote Originally Posted by Arnoutdv View Post
    ...etc...
    Thanks, I forgot about the ListSubitems collection.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

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