The Header Control | CodeGuru

The Header Control

When the list view control is in the report it usually displays a header control to label the columns. Often times we need to get hold of the header control. This header control is a child window of the list view control and always has the ID 0. CHeaderCtrl* pHeader =(CHeaderCtrl*)m_listctrl.GetDlgItem(0); The header control exists […]

Written By
CodeGuru Staff
CodeGuru Staff
Aug 6, 1998
2 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

When the list view control is in the report it usually


displays a header control to label the columns. Often times we need to


get hold of the header control. This header control is a child window of


the list view control and always has the ID 0.

CHeaderCtrl* pHeader =(CHeaderCtrl*)m_listctrl.GetDlgItem(0);

The header control exists even if the list view is not in the report mode.
When the list view mode is other that the LVS_REPORT, the dimensions of
the header control is zero.

 

Comments:

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.