Solved

Header in a CListView?

Posted on 1998-09-24
1
335 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 8

Accepted Solution

by:
Answers2000 earned 40 total points
ID: 1322556
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

707 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