sorting a CListCtrl by clicking on one of it's column's headers makes an arrow appear, but also makes the header appear flat
-
Hi guys. I'm using a third party MFC CListCtrl inheriting class, that comes with its own CHeaderCtrl inheriting class - http://www.codeproject.com/KB/list/creportctrl.aspx[^] . It works well, but the function that updates the header of the CListCtrl to display the arrow that indicates the order of a given sort (ascending or descending) has an undesirable side effect; when called, it makes the sorted column's header appear completely flat, rather than 3D, and when the cursor rolls over the column it doesn't become highlighted. This only seems to be a problem in Windows XP. Here's the relevant code:
void CReportCtrl::CReportHeaderCtrl::UpdateSortArrow()
{// change the item to owner drawn. HD\_ITEM hditem; hditem.mask = HDI\_FORMAT; VERIFY(GetItem(m\_iSortColumn, &hditem)); hditem.fmt |= HDF\_OWNERDRAW; VERIFY(SetItem(m\_iSortColumn, &hditem)); // invalidate the header control so it gets redrawn Invalidate();
}
If one of you could suggest a way of avoiding this, and having the arrow appear without changing the appearance of the header, that would certainly be appreciated, Regards, Sternocera