Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. how to change text color an item in listview C#?

how to change text color an item in listview C#?

Scheduled Pinned Locked Moved C#
questioncsharptutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    ping_jacob
    wrote on last edited by
    #1

    i need to change text color an item in listview on C# i can change text color in listview on properties but that change all items in listview i don't want change text color all items but i need to change an item or some items how can i do it? please give some hints or tips to me thanks a lot....^^

    D E 2 Replies Last reply
    0
    • P ping_jacob

      i need to change text color an item in listview on C# i can change text color in listview on properties but that change all items in listview i don't want change text color all items but i need to change an item or some items how can i do it? please give some hints or tips to me thanks a lot....^^

      E Offline
      E Offline
      Ennis Ray Lynch Jr
      wrote on last edited by
      #2

      The ListViewItem item in the Items collection should have a BackColor property which can be set.

      Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
      If you don't ask questions the answers won't stand in your way.
      Most of this sig is for Google, not ego.

      1 Reply Last reply
      0
      • P ping_jacob

        i need to change text color an item in listview on C# i can change text color in listview on properties but that change all items in listview i don't want change text color all items but i need to change an item or some items how can i do it? please give some hints or tips to me thanks a lot....^^

        D Offline
        D Offline
        DaveyM69
        wrote on last edited by
        #3

        This will colour the first item Red and it's first sub item blue:

        listView1.Items[0].UseItemStyleForSubItems = false;
        listView1.Items[0].ForeColor = System.Drawing.Color.Red;
        listView1.Items[0].SubItems[1].ForeColor = System.Drawing.Color.Blue;

        Dave
        BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
        Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups