Search code examples
c#winformslistviewcolorsselection

Change background selection color of ListView?


How can I change the selection color on a ListView? By default, when the user selects an item it shows a blue background. I want to change this to dark gray, or something... Thanks for the help!


Solution

  • ObjectListView -- a wrapper around a WinForm ListView -- has properties to let you control the background and foreground color of the selected rows. It uses the technique that Obalix suggested, but it has already done the hard work for you.

    So, with a little effort, you can produce something like this:

    alt text
    (source: codeproject.com)

    The "Feel Good Inc" row show a custom foreground and background for selection.