tags:

views:

44

answers:

1

how to change highlight color in list control in mfc. i havn't found any api in clistctrl. i have override NM_CUSTOMDRAW as descripbed in msdn but when i clicked on any item on list it showing half blue color and half black color why blue is coming ?

+1  A: 

You need to override NM_CUSTOMDRAW handler. Check this sample.

Kirill V. Lyadvinsky
thanks for the link.i tried this but on clicking on list control items it is getting highlighted with blue..what would be the problem?
@user323422, can't say without seeing your code.
Kirill V. Lyadvinsky
@Kirill V. Lyadvinsky is blue is default highlight color?
Default highlight color is defined by current Windows theme. In your case it is blue.
Kirill V. Lyadvinsky
how to change it?
You can override it in the `NM_CUSTOMDRAW` handler. Set `clrTextBk` field of `NMLVCUSTOMDRAW` structure when `nmcd.uItemState` is equal to `CDIS_FOCUS`.
Kirill V. Lyadvinsky