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
2010-09-03 05:50:47
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?
2010-09-03 06:25:51
@user323422, can't say without seeing your code.
Kirill V. Lyadvinsky
2010-09-03 06:44:09
@Kirill V. Lyadvinsky is blue is default highlight color?
2010-09-03 06:47:06
Default highlight color is defined by current Windows theme. In your case it is blue.
Kirill V. Lyadvinsky
2010-09-03 06:51:50
how to change it?
2010-09-03 07:15:35
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
2010-09-03 07:23:16