Solved

Header in a CListView?

Posted on 1998-09-24
1
291 Views
Last Modified: 2013-11-19
Hi,
I have used the class ClistView to display data in
a report view style.
I have tried to catch the message LVN_COLUMNCLICK
to test whether I have click the header or not.
Now, I want to know whether the first header,second header,
third header,etc had been clicked.
Now I cannot get the no. of column which had been clicked.
How can I get this?

Thanks
P.S. I haven't used the class CHeaderCtrl until now.
0
Comment
Question by:kkuu
1 Comment
 
LVL 8

Accepted Solution

by:
Answers2000 earned 40 total points
Comment Utility
You don't need to add you're own header control, there's one built into the list control for report view (it is a header control wndow which is a child of the list, a bit like the edit control built into combo boxes, or the scroll bars built into multi line edit controls)

You get the column number click as part of the LVN_COLUMNCLICK notification sent to your listctrl, here's how

void CTComply::OnColumnclickList1(NMHDR* pNMHDR, LRESULT* pResult)
{
      NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;

      int nColumnClicked = pNMListView->iSubItem ;

              // Add code here, nColumnClicked is the column number

      *pResult = 0;
}

0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Expand data scrubbing tool 13 29
Doc'in system (example?) BA 7 78
has22 challenge 11 70
either24  challenge 19 84
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

772 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

11 Experts available now in Live!

Get 1:1 Help Now