Solved

Header in a CListView?

Posted on 1998-09-24
1
320 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
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB.NET how to use the Vertical ScrollBar 5 113
canBalance challenge 34 96
Annoying "thing" blocks my view 4 114
JQuery serialize and unserialize 8 134
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

808 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