Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Header in a CListView?

Posted on 1998-09-24
1
Medium Priority
?
339 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 160 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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…
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…
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.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

636 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