dcsimg

Getting the number of columns in the report view

WEBINAR:
On-Demand

Desktop-as-a-Service Designed for Any Cloud ? Nutanix Frame



To get the number of columns in the list view control, we first get a pointer to the header control and then use the header control to query the number of columns it has.
CHeaderCtrl* pHeader = (CHeaderCtrl*) m_listctrl.GetDlgItem(0);
int nColumnCount = pHeader->GetItemCount();
This works even when the listview control has the LVS_NOCOLUMNHEADER style. It also works if the control is not in the report view.
 



Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date