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