Mfc-list control. InsertColumn () cannot insert issue

Source: Internet
Author: User
Recently, you need to use the CListCtrl control to do a project.

When adding each column header, call the InsertColumn function,

M_listrweprom.insertcolumn (0, _t ("read-write Eprom"), Lvcfmt_left, 40);//Insert Column,

However, there is no effect after the program runs, and the entire control area appears blank.

After querying the data, it is found that before calling the InsertColumn function, you need to set the CListCtrl control's style to Lvs_report.

The following are the specific practices:

Long Styles;

Styles = GetWindowLong (M_listrweprom.m_hwnd,gwl_style);//Get window style

M_listrweprom.setwindowlong (M_listrweprom.m_hwnd,gwl_style,styles | Lvs_report); Set a new window style

Although not very complicated, but did not know before, delayed for one hours, ashamed Ah! Shame on you! Shame on you!

Mfc-list control. InsertColumn () cannot insert issue

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.