Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. sorting a CListCtrl by clicking on one of it's column's headers makes an arrow appear, but also makes the header appear flat

sorting a CListCtrl by clicking on one of it's column's headers makes an arrow appear, but also makes the header appear flat

Scheduled Pinned Locked Moved C / C++ / MFC
c++comalgorithmshelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sternocera
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups