Chaning the highlight color for a ListView

Posted on 2006-05-11
Last Modified: 2012-05-05

I find the selection color to be too light, when I make a selection in my ListView programmatically.  When I select the ListViewItem with a mouse, it hightlights the selection nicely.

Here's how I select the first item.  What else can I do?


driverLV.Items[0].Selected = true;
Question by:ba272

    Author Comment

    LVL 19

    Expert Comment

    With a normal listview you cannot do this.. you have to develop your own listview control and have this feature
    LVL 1

    Expert Comment


    I think after the


    line another control takes the focus and your listviews HideSelection property is set to false. Inspect your code if another control gets the focus.
    LVL 20

    Expert Comment

    Here is a custom draw list view, maybe it can help you:
    LVL 19

    Assisted Solution

    yes its one of them
    you can find more here:

    this one is my favourite
    and i have used it in one of my app
    LVL 11

    Accepted Solution

    if you are using net 2, you can use the custom draw event.
    if you are using net 1, you will have to derive from the listview and go into its wndroc to listen for incoming tvm notify messages.
    that is alot of work you will have todo, because you will have to go through 4 different notify stages and do alot of drawing by your own.
    i recommend that you are using one of the posted listviews unless you have a good reason, why you would have to go down to win32 api.

    Featured Post

    Live: Real-Time Solutions, Start Here

    Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

    Join & Write a Comment

    Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
    We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now